From 5128da0ffd4f266cff1272edf9ae363e0e6d08d1 Mon Sep 17 00:00:00 2001 From: Fuzzbawls Date: Fri, 15 Jan 2021 22:57:46 -0800 Subject: [PATCH] [RPC] Fix argument parsing and example for getbalance First argument is now a numeric, which needs to be added to the conversion table. Also fix the example command usage by dropping the no longer existing "account" argument. --- src/rpc/client.cpp | 2 +- src/wallet/rpcwallet.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index e74732d70bb22..2c00eeb6b81ab 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -50,10 +50,10 @@ static const CRPCConvertParam vRPCConvertParams[] = { { "listreceivedbylabel", 0 }, { "listreceivedbylabel", 1 }, { "listreceivedbylabel", 2 }, + { "getbalance", 0 }, { "getbalance", 1 }, { "getbalance", 2 }, { "getbalance", 3 }, - { "getbalance", 4 }, { "getshieldbalance", 1 }, { "getshieldbalance", 2 }, { "rawshieldsendmany", 1 }, diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 84049516ccdda..3c6cc1721a37c 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1958,7 +1958,7 @@ UniValue getbalance(const JSONRPCRequest& request) "thus affected by options which limit spendability such as -spendzeroconfchange.\n" "\nArguments:\n" - "1. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" + "1. minconf (numeric, optional, default=0) Only include transactions confirmed at least this many times.\n" "2. includeWatchonly (bool, optional, default=false) Also include balance in watchonly addresses (see 'importaddress')\n" "3. includeDelegated (bool, optional, default=true) Also include balance delegated to cold stakers\n" "4. includeShield (bool, optional, default=true) Also include shield balance\n" @@ -1970,9 +1970,9 @@ UniValue getbalance(const JSONRPCRequest& request) "\nThe total amount in the wallet\n" + HelpExampleCli("getbalance", "") + "\nThe total amount in the wallet, with at least 5 confirmations\n" + - HelpExampleCli("getbalance", "\"*\" 6") + + HelpExampleCli("getbalance", "6") + "\nAs a json rpc call\n" + - HelpExampleRpc("getbalance", "\"*\", 6")); + HelpExampleRpc("getbalance", "6")); LOCK2(cs_main, pwalletMain->cs_wallet);