From d24a41496af5163a70bd250eb0ca39579d031a1d Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 9 Feb 2022 17:03:24 -0700 Subject: [PATCH] Clarify documentation of z_getbalanceforviewingkey for Sprout viewing keys. --- doc/release-notes.md | 6 ++++-- src/wallet/rpcwallet.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 62f9f84a4..d17cb6c30 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -48,8 +48,10 @@ New RPC Methods process table; `zcashd-wallet-tool` is specifically provided to avoid this problem. - 'z_getbalanceforviewingkey' This newly created API allows a user to obtain - balance information for funds visible to a Sprout, Sapling, or Unified full - viewing key. + balance information for funds visible to a Sapling or Unified full + viewing key; if a Sprout viewing key is provided, this method allows + retrieval of the balance only in the case that the wallet controls the + corresponding spending key. RPC Changes ----------- diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index fdf852c26..7a874c747 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3627,6 +3627,7 @@ UniValue z_getbalanceforviewingkey(const UniValue& params, bool fHelp) throw runtime_error( "z_getbalanceforviewingkey \"fvk\" ( minconf )\n" "\nReturns the per-pool balances viewable by a full viewing key known to the node's wallet." + "\nSprout viewing keys may be used only if the wallet controls the corresponding spending key." "\nArguments:\n" "1. \"fvk\" (string) The selected full viewing key.\n" "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n"