From c3d6b0651885871d59bd73e16c8077190edc11b1 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Mon, 10 Sep 2018 12:23:42 +0200 Subject: [PATCH] Remove redundant check for unknown commands in masternode RPC (#2279) --- src/rpc/masternode.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/rpc/masternode.cpp b/src/rpc/masternode.cpp index 3761bd5a4..3aaacc05a 100644 --- a/src/rpc/masternode.cpp +++ b/src/rpc/masternode.cpp @@ -878,16 +878,9 @@ UniValue masternode(const JSONRPCRequest& request) throw JSONRPCError(RPC_INVALID_PARAMETER, "DEPRECATED, please use start-all instead"); #endif // ENABLE_WALLET - if ((request.fHelp && strCommand.empty()) || - ( -#ifdef ENABLE_WALLET - strCommand != "start-alias" && strCommand != "start-all" && strCommand != "start-missing" && - strCommand != "start-disabled" && strCommand != "outputs" && -#endif // ENABLE_WALLET - strCommand != "list" && strCommand != "list-conf" && strCommand != "count" && - strCommand != "debug" && strCommand != "current" && strCommand != "winner" && strCommand != "winners" && strCommand != "genkey" && - strCommand != "connect" && strCommand != "status" && strCommand != "check")) - masternode_help(); + if (request.fHelp && strCommand.empty()) { + masternode_help(); + } if (strCommand == "list") { return masternode_list(request); @@ -925,9 +918,10 @@ UniValue masternode(const JSONRPCRequest& request) return masternode_winners(request); } else if (strCommand == "check") { return masternode_check(request); + } else { + masternode_help(); + return UniValue::VNULL; // avoid compiler warnings } - - throw std::runtime_error("invalid command: " + strCommand); } UniValue masternodelist(const JSONRPCRequest& request)