mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 04:52:36 +02:00
CLI: Only one Request Handler can be specified. Previously it was possible to specify multiple, however only one was picked in this arbitrary and (probably) undocumented priority: getinfo > netinfo > generate > addrinfo.
Github-Pull: #27815
Rebased-From: 244e6c8db8
This commit is contained in:
parent
42af9596ce
commit
468087b183
@ -955,6 +955,14 @@ static int CommandLineRPC(int argc, char *argv[])
|
||||
fputc('\n', stdout);
|
||||
}
|
||||
}
|
||||
int nRh = 0;
|
||||
if (gArgs.IsArgSet("-getinfo")) nRh++;
|
||||
if (gArgs.GetBoolArg("-netinfo", false)) nRh++;
|
||||
if (gArgs.GetBoolArg("-generate", false)) nRh++;
|
||||
if (gArgs.GetBoolArg("-addrinfo", false)) nRh++;
|
||||
if (nRh > 1) {
|
||||
throw std::runtime_error("Only one of \"-getinfo\", \"-netinfo\", \"-generate\", and \"-addrinfo\" may be specified.");
|
||||
}
|
||||
std::unique_ptr<BaseRequestHandler> rh;
|
||||
std::string method;
|
||||
if (gArgs.IsArgSet("-getinfo")) {
|
||||
|
Loading…
Reference in New Issue
Block a user