mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 11:44:14 +01:00
rpc: switch to using RPCHelpMan.Check()
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user