diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 91ecc9cf4..5803c117d 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -220,6 +220,7 @@ class WalletTest (BitcoinTestFramework): if uTx['txid'] == zeroValueTxid: found = True assert_equal(uTx['amount'], Decimal('0.00000000')) + assert_equal(uTx['amountZat'], int('0')) assert(found) #do some -walletbroadcast tests diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 70e423e62..cf43d0e21 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2411,6 +2411,7 @@ UniValue listunspent(const UniValue& params, bool fHelp) " \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n" " \"scriptPubKey\" : \"key\", (string) the script key\n" " \"amount\" : x.xxx, (numeric) the transaction amount in " + CURRENCY_UNIT + "\n" + " \"amountZat\" : xxxx (numeric) the transaction amount in zatoshis\n" " \"confirmations\" : n, (numeric) The number of confirmations\n" " \"redeemScript\" : n (string) The redeemScript if scriptPubKey is P2SH\n" " \"spendable\" : xxx (bool) Whether we have the private keys to spend this output\n" @@ -2486,6 +2487,7 @@ UniValue listunspent(const UniValue& params, bool fHelp) entry.pushKV("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end())); entry.pushKV("amount", ValueFromAmount(out.tx->vout[out.i].nValue)); + entry.pushKV("amountZat", out.tx->vout[out.i].nValue); entry.pushKV("confirmations", out.nDepth); entry.pushKV("spendable", out.fSpendable); results.push_back(entry);