diff --git a/qa/rpc-tests/wallet_accounts.py b/qa/rpc-tests/wallet_accounts.py index 88996cb41..a8f41b0c9 100755 --- a/qa/rpc-tests/wallet_accounts.py +++ b/qa/rpc-tests/wallet_accounts.py @@ -176,6 +176,10 @@ class WalletAccountsTest(BitcoinTestFramework): self.check_balance(0, 0, ua0, {'sapling': 9}) self.check_balance(0, 0, ua0, {'sapling': 9, 'orchard': 10}, 0) + # The total balance with the default minconf should be just the Sapling balance + assert_equal('9.00', self.nodes[0].z_gettotalbalance()['private']) + assert_equal('19.00', self.nodes[0].z_gettotalbalance(0)['private']) + self.nodes[2].generate(1) self.sync_all() diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 0517fc5ec..d9eaf6c1d 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3410,6 +3410,9 @@ CAmount getBalanceZaddr(std::optional address, int min for (auto & entry : saplingEntries) { balance += CAmount(entry.note.value()); } + for (auto & entry : orchardEntries) { + balance += entry.GetNoteValue(); + } return balance; } @@ -4407,7 +4410,7 @@ size_t EstimateTxSize( [&](const libzcash::OrchardRawAddress& addr) { if (fromSprout) { throw JSONRPCError( - RPC_INVALID_PARAMETER, + RPC_INVALID_PARAMETER, "Sending funds from a Sprout address to a Unified Address is not supported by z_sendmany"); } orchardRecipientCount += 1; @@ -4419,7 +4422,7 @@ size_t EstimateTxSize( if (fromSprout || !nu5Active) { mtx.nVersionGroupId = SAPLING_VERSION_GROUP_ID; - mtx.nVersion = SAPLING_TX_VERSION; + mtx.nVersion = SAPLING_TX_VERSION; } else { mtx.nVersionGroupId = ZIP225_VERSION_GROUP_ID; mtx.nVersion = ZIP225_TX_VERSION;