rpcwallet.cpp: Cast size_t to uint64_t before passing to UniValue

This commit is contained in:
Jack Grigg 2017-12-23 10:28:27 +00:00
parent 8e95a12b63
commit 4ff92bb6d8
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with 8 additions and 8 deletions

View File

@ -1341,7 +1341,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
entry.push_back(Pair("fee", ValueFromAmount(-nFee)));
if (fLong)
WalletTxToJSON(wtx, entry);
entry.push_back(Pair("size", static_cast<CTransaction>(wtx).GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION)));
entry.push_back(Pair("size", static_cast<uint64_t>(static_cast<CTransaction>(wtx).GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION))));
ret.push_back(entry);
}
}
@ -1378,7 +1378,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
entry.push_back(Pair("vout", r.vout));
if (fLong)
WalletTxToJSON(wtx, entry);
entry.push_back(Pair("size", static_cast<CTransaction>(wtx).GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION)));
entry.push_back(Pair("size", static_cast<uint64_t>(static_cast<CTransaction>(wtx).GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION))));
ret.push_back(entry);
}
}
@ -3748,9 +3748,9 @@ UniValue z_shieldcoinbase(const UniValue& params, bool fHelp)
// Return continuation information
UniValue o(UniValue::VOBJ);
o.push_back(Pair("remainingUTXOs", utxoCounter - numUtxos));
o.push_back(Pair("remainingUTXOs", static_cast<uint64_t>(utxoCounter - numUtxos)));
o.push_back(Pair("remainingValue", ValueFromAmount(remainingValue)));
o.push_back(Pair("shieldingUTXOs", numUtxos));
o.push_back(Pair("shieldingUTXOs", static_cast<uint64_t>(numUtxos)));
o.push_back(Pair("shieldingValue", ValueFromAmount(shieldedValue)));
o.push_back(Pair("opid", operationId));
return o;
@ -4086,13 +4086,13 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp)
// Return continuation information
UniValue o(UniValue::VOBJ);
o.push_back(Pair("remainingUTXOs", utxoCounter - numUtxos));
o.push_back(Pair("remainingUTXOs", static_cast<uint64_t>(utxoCounter - numUtxos)));
o.push_back(Pair("remainingTransparentValue", ValueFromAmount(remainingUTXOValue)));
o.push_back(Pair("remainingNotes", noteCounter - numNotes));
o.push_back(Pair("remainingNotes", static_cast<uint64_t>(noteCounter - numNotes)));
o.push_back(Pair("remainingShieldedValue", ValueFromAmount(remainingNoteValue)));
o.push_back(Pair("mergingUTXOs", numUtxos));
o.push_back(Pair("mergingUTXOs", static_cast<uint64_t>(numUtxos)));
o.push_back(Pair("mergingTransparentValue", ValueFromAmount(mergedUTXOValue)));
o.push_back(Pair("mergingNotes", numNotes));
o.push_back(Pair("mergingNotes", static_cast<uint64_t>(numNotes)));
o.push_back(Pair("mergingShieldedValue", ValueFromAmount(mergedNoteValue)));
o.push_back(Pair("opid", operationId));
return o;