diff options
author | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2019-06-19 13:59:11 +0900 |
---|---|---|
committer | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2019-07-08 09:53:52 +0900 |
commit | b6fb617aaaad5f9cdd7f2ad2825b253ca792055d (patch) | |
tree | f4de15cab1cb053a1afaa03ba215bafe423d68a7 /src/rpc/server.cpp | |
parent | c7a9fc234f3ce400ce78b9b434d2d210b2646c50 (diff) |
rpc: switch to using RPCHelpMan.Check()
Diffstat (limited to 'src/rpc/server.cpp')
-rw-r--r-- | src/rpc/server.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 8b7b517473..f6db74b6ed 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -178,8 +178,6 @@ UniValue stop(const JSONRPCRequest& jsonRequest) static UniValue uptime(const JSONRPCRequest& jsonRequest) { - if (jsonRequest.fHelp || jsonRequest.params.size() > 0) - throw std::runtime_error( RPCHelpMan{"uptime", "\nReturns the total uptime of the server.\n", {}, @@ -190,15 +188,13 @@ static UniValue uptime(const JSONRPCRequest& jsonRequest) HelpExampleCli("uptime", "") + HelpExampleRpc("uptime", "") }, - }.ToString()); + }.Check(jsonRequest); return GetTime() - GetStartupTime(); } static UniValue getrpcinfo(const JSONRPCRequest& request) { - if (request.fHelp || request.params.size() > 0) { - throw std::runtime_error( RPCHelpMan{"getrpcinfo", "\nReturns details of the RPC server.\n", {}, @@ -216,9 +212,7 @@ static UniValue getrpcinfo(const JSONRPCRequest& request) RPCExamples{ HelpExampleCli("getrpcinfo", "") + HelpExampleRpc("getrpcinfo", "")}, - }.ToString() - ); - } + }.Check(request); LOCK(g_rpc_server_info.mutex); UniValue active_commands(UniValue::VARR); |