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

@@ -262,10 +262,10 @@ static RPCHelpMan addnode()
std::string strCommand;
if (!request.params[1].isNull())
strCommand = request.params[1].get_str();
if (request.fHelp || request.params.size() != 2 ||
(strCommand != "onetry" && strCommand != "add" && strCommand != "remove"))
if (strCommand != "onetry" && strCommand != "add" && strCommand != "remove") {
throw std::runtime_error(
self.ToString());
}
NodeContext& node = EnsureNodeContext(request.context);
if(!node.connman)
@@ -604,7 +604,7 @@ static RPCHelpMan setban()
std::string strCommand;
if (!request.params[1].isNull())
strCommand = request.params[1].get_str();
if (request.fHelp || !help.IsValidNumArgs(request.params.size()) || (strCommand != "add" && strCommand != "remove")) {
if (strCommand != "add" && strCommand != "remove") {
throw std::runtime_error(help.ToString());
}
NodeContext& node = EnsureNodeContext(request.context);