From d423fd9ec83ae323ac29bdc1b677ed8260bd59c4 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sat, 22 Feb 2025 13:58:30 -0600 Subject: [PATCH] cli, bugfix: for -getinfo, replace IsArgSet() with GetBoolArg() for consistency with the other CLI commands (-netinfo, -addrinfo, -generate). This can be considered a bugfix because IsArgSet() returns whether an arg has been set even if it has been negated. After this change, we no longer treat -nogetinfo and -getinfo=0 the same as -getinfo and -getinfo=1, and instead as if -getinfo was not specified. Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Co-authored-by: Ryan Ofsky --- src/bitcoin-cli.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 7aa9dc1ea1a..863b495fb25 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -1248,7 +1248,7 @@ static int CommandLineRPC(int argc, char *argv[]) gArgs.CheckMultipleCLIArgs(); std::unique_ptr rh; std::string method; - if (gArgs.IsArgSet("-getinfo")) { + if (gArgs.GetBoolArg("-getinfo", false)) { rh.reset(new GetinfoRequestHandler()); } else if (gArgs.GetBoolArg("-netinfo", false)) { if (!args.empty() && (args.at(0) == "h" || args.at(0) == "help")) {