remove dead rpc code

Checking for fHelp, or the size of the args, is dead code because:
* fHelp is always false (src/qt/test/rpcnestedtests.cpp)
* It is already implicitly called by RPCHelpMan::Check
  (src/rpc/mining.cpp, src/rpc/misc.cpp, src/rpc/net.cpp)
This commit is contained in:
MarcoFalke
2020-09-22 19:08:36 +02:00
parent 1b313cacc9
commit fa19bb2cd8
4 changed files with 3 additions and 13 deletions

View File

@@ -242,12 +242,7 @@ static RPCHelpMan generatetodescriptor()
static RPCHelpMan generate()
{
return RPCHelpMan{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
if (request.fHelp) {
throw std::runtime_error(self.ToString());
} else {
throw JSONRPCError(RPC_METHOD_NOT_FOUND, self.ToString());
}
}};
}