1
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-13 11:35:20 +01:00

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 <ryan@ofsky.org>
This commit is contained in:
Jon Atack 2025-02-22 13:58:30 -06:00
parent e99e41b307
commit d423fd9ec8

View file

@ -1248,7 +1248,7 @@ static int CommandLineRPC(int argc, char *argv[])
gArgs.CheckMultipleCLIArgs();
std::unique_ptr<BaseRequestHandler> 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")) {