From 4ff92bb6d806a3887fcc22f8df87a8329e439b64 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 23 Dec 2017 10:28:27 +0000 Subject: [PATCH] rpcwallet.cpp: Cast size_t to uint64_t before passing to UniValue --- src/wallet/rpcwallet.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index b242580b1..8725b5d00 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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(wtx).GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION))); + entry.push_back(Pair("size", static_cast(static_cast(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(wtx).GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION))); + entry.push_back(Pair("size", static_cast(static_cast(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(utxoCounter - numUtxos))); o.push_back(Pair("remainingValue", ValueFromAmount(remainingValue))); - o.push_back(Pair("shieldingUTXOs", numUtxos)); + o.push_back(Pair("shieldingUTXOs", static_cast(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(utxoCounter - numUtxos))); o.push_back(Pair("remainingTransparentValue", ValueFromAmount(remainingUTXOValue))); - o.push_back(Pair("remainingNotes", noteCounter - numNotes)); + o.push_back(Pair("remainingNotes", static_cast(noteCounter - numNotes))); o.push_back(Pair("remainingShieldedValue", ValueFromAmount(remainingNoteValue))); - o.push_back(Pair("mergingUTXOs", numUtxos)); + o.push_back(Pair("mergingUTXOs", static_cast(numUtxos))); o.push_back(Pair("mergingTransparentValue", ValueFromAmount(mergedUTXOValue))); - o.push_back(Pair("mergingNotes", numNotes)); + o.push_back(Pair("mergingNotes", static_cast(numNotes))); o.push_back(Pair("mergingShieldedValue", ValueFromAmount(mergedNoteValue))); o.push_back(Pair("opid", operationId)); return o;