Fix amounts formatting in decoderawtransaction and getsuperblockbudget

This commit is contained in:
UdjinM6 2019-08-08 14:02:03 +03:00 committed by Pasta
parent a82f22e528
commit c853c012ee
No known key found for this signature in database
GPG Key ID: D362C9F7142766AE
2 changed files with 2 additions and 6 deletions

View File

@ -186,8 +186,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
auto it = ptxSpentInfo->mSpentInfo.find(spentKey);
if (it != ptxSpentInfo->mSpentInfo.end()) {
auto spentInfo = it->second;
UniValue outValue(UniValue::VNUM, FormatMoney(spentInfo.satoshis));
in.push_back(Pair("value", outValue));
in.push_back(Pair("value", ValueFromAmount(spentInfo.satoshis)));
in.push_back(Pair("valueSat", spentInfo.satoshis));
if (spentInfo.addressType == 1) {
in.push_back(Pair("address", CBitcoinAddress(CKeyID(spentInfo.addressHash)).ToString()));

View File

@ -1078,10 +1078,7 @@ UniValue getsuperblockbudget(const JSONRPCRequest& request)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
}
CAmount nBudget = CSuperblock::GetPaymentsLimit(nBlockHeight);
std::string strBudget = FormatMoney(nBudget);
return strBudget;
return ValueFromAmount(CSuperblock::GetPaymentsLimit(nBlockHeight));
}
static const CRPCCommand commands[] =