diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -578,7 +578,7 @@ * @param result Reference to UniValue object the wallet names and balances are * pushed to. */ -[[maybe_unused]] static void GetWalletBalances(UniValue &result) { +static void GetWalletBalances(UniValue &result) { std::unique_ptr rh{ std::make_unique()}; const UniValue listwallets = @@ -664,9 +664,8 @@ } std::unique_ptr 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) { @@ -709,6 +708,10 @@ } } } else { + if (gArgs.IsArgSet("-getinfo") && !gArgs.IsArgSet("-rpcwallet")) { + // fetch multiwallet balances and append to result + GetWalletBalances(result); + } // Result if (result.isNull()) { strPrint = "";