diff --git a/doc/release-notes-17783.md b/doc/release-notes-17783.md index a2fb1fdc533f6..9f51fcf2a5310 100644 --- a/doc/release-notes-17783.md +++ b/doc/release-notes-17783.md @@ -1,4 +1,4 @@ Configuration ------------- -Some corner cases handling negated list options `-norpcallowip`, `-norpcbind`, `-nobind`, `-nowhitebind`, `-noconnect`, `-noexternalip`, `-noonlynet`, `-nosignetchallenge`, `-nosignetseednode` have been fixed. Now negating these options is the same as not specifying them at all. +Some corner cases handling negated list options `-norpcallowip`, `-norpcbind`, `-nobind`, `-nowhitebind`, `-noconnect`, `-noexternalip`, `-noonlynet`, `-nosignetchallenge`, `-nosignetseednode`, `-norpcwallet` have been fixed. Now negating these options is the same as not specifying them at all. diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 279521a761311..bb11c1a1ae98b 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -1061,7 +1061,7 @@ static void ParseGetInfoResult(UniValue& result) static UniValue GetNewAddress() { std::optional wallet_name{}; - if (gArgs.IsArgSet("-rpcwallet")) wallet_name = gArgs.GetArg("-rpcwallet", ""); + if (gArgs.IsArgSet("-rpcwallet") && !gArgs.IsArgNegated("-rpcwallet")) wallet_name = gArgs.GetArg("-rpcwallet", ""); DefaultRequestHandler rh; return ConnectAndCallRPC(&rh, "getnewaddress", /* args=*/{}, wallet_name); } @@ -1168,7 +1168,7 @@ static int CommandLineRPC(int argc, char *argv[]) if (nRet == 0) { // Perform RPC call std::optional wallet_name{}; - if (gArgs.IsArgSet("-rpcwallet")) wallet_name = gArgs.GetArg("-rpcwallet", ""); + if (gArgs.IsArgSet("-rpcwallet") && !gArgs.IsArgNegated("-rpcwallet")) wallet_name = gArgs.GetArg("-rpcwallet", ""); const UniValue reply = ConnectAndCallRPC(rh.get(), method, args, wallet_name); // Parse reply @@ -1176,7 +1176,7 @@ static int CommandLineRPC(int argc, char *argv[]) const UniValue& error = find_value(reply, "error"); if (error.isNull()) { if (gArgs.GetBoolArg("-getinfo", false)) { - if (!gArgs.IsArgSet("-rpcwallet")) { + if (!gArgs.IsArgSet("-rpcwallet") || gArgs.IsArgNegated("-rpcwallet")) { GetWalletBalances(result); // fetch multiwallet balances and append to result } ParseGetInfoResult(result);