Skip to content

Commit afce85e

Browse files
committed
cli: use GetWalletBalances() functionality for -getinfo
and replace GetBoolArg with IsArgSet as we only want to know if the arg is passed; we do not need the value.
1 parent 9f01849 commit afce85e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bitcoin-cli.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,8 @@ static int CommandLineRPC(int argc, char *argv[])
532532
}
533533
std::unique_ptr<BaseRequestHandler> rh;
534534
std::string method;
535-
if (gArgs.GetBoolArg("-getinfo", false)) {
535+
if (gArgs.IsArgSet("-getinfo")) {
536536
rh.reset(new GetinfoRequestHandler());
537-
method = "";
538537
} else {
539538
rh.reset(new DefaultRequestHandler());
540539
if (args.size() < 1) {
@@ -567,6 +566,9 @@ static int CommandLineRPC(int argc, char *argv[])
567566
}
568567
}
569568
} else {
569+
if (gArgs.IsArgSet("-getinfo") && !gArgs.IsArgSet("-rpcwallet")) {
570+
GetWalletBalances(result); // fetch multiwallet balances and append to result
571+
}
570572
// Result
571573
if (result.isNull()) {
572574
strPrint = "";

0 commit comments

Comments
 (0)