Skip to content

Commit

Permalink
cli: more robust bitcoin-cli -getinfo command parsing
Browse files Browse the repository at this point in the history
per Luke Dashjr review feedback in PR 18594

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

0 comments on commit 2be8ee8

Please sign in to comment.