Skip to content

Commit

Permalink
cli: use GetWalletBalances() functionality for -getinfo
Browse files Browse the repository at this point in the history
and replace GetBoolArg with IsArgSet as we only want
to know if the arg is passed; we do not need the value.

Github-Pull: bitcoin#18594
Rebased-From: afce85e
  • Loading branch information
jonatack authored and luke-jr committed May 28, 2020
1 parent 0455407 commit c46c5c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,8 @@ static int CommandLineRPC(int argc, char *argv[])
}
std::unique_ptr<BaseRequestHandler> rh;
std::string method;
if (gArgs.GetBoolArg("-getinfo", false)) {
if (gArgs.IsArgSet("-getinfo")) {
rh.reset(new GetinfoRequestHandler());
method = "";
} else {
rh.reset(new DefaultRequestHandler());
if (args.size() < 1) {
Expand Down Expand Up @@ -565,6 +564,9 @@ static int CommandLineRPC(int argc, char *argv[])
}
}
} else {
if (gArgs.IsArgSet("-getinfo") && !gArgs.IsArgSet("-rpcwallet")) {
GetWalletBalances(result); // fetch multiwallet balances and append to result
}
// Result
if (result.isNull()) {
strPrint = "";
Expand Down

0 comments on commit c46c5c1

Please sign in to comment.