diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 3a1cc1e29..93a43875a 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3706,9 +3706,18 @@ UniValue z_getbalance(const UniValue& params, bool fHelp) nBalance = getBalanceZaddr(addr, nMinDepth, INT_MAX, false); }, [&](const libzcash::UnifiedAddress& addr) { - throw JSONRPCError( - RPC_INVALID_ADDRESS_OR_KEY, - "Unified addresses are not yet supported for z_getbalance."); + auto selector = pwalletMain->ZTXOSelectorForAddress(addr, true); + auto spendableInputs = pwalletMain->FindSpendableInputs(selector.value(), true, nMinDepth); + + for (const auto& t : spendableInputs.utxos) { + nBalance += t.Value(); + } + for (const auto& t : spendableInputs.saplingNoteEntries) { + nBalance += t.note.value(); + } + for (const auto& t : spendableInputs.orchardNoteMetadata) { + nBalance += t.GetNoteValue(); + } }, }, pa.value()); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a84895780..ee9b3eeee 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -6341,6 +6341,9 @@ NoteFilter NoteFilter::ForPaymentAddresses(const std::vector