Skip to content

Commit

Permalink
[RPC] Fix argument parsing and example for getbalance
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Fuzzbawls committed Jan 16, 2021
1 parent 15042c1 commit 5128da0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
6 changes: 3 additions & 3 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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);

Expand Down

0 comments on commit 5128da0

Please sign in to comment.