cli: more robust bitcoin-cli -getinfo command parsing

per Luke Dashjr review feedback in PR 18594
This commit is contained in:
Jon Atack 2020-05-25 18:52:02 +02:00 committed by Luke Dashjr
parent bbbf89a9de
commit d7d77a38b3

View File

@ -1162,7 +1162,7 @@ static int CommandLineRPC(int argc, char *argv[])
}
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) == "help") {