mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 23:42:33 +02:00
wallet: Use IsValidNumArgs in getwalletinfo rpc
This commit is contained in:
parent
2eb8c5d7a2
commit
fad40ec915
@ -2382,9 +2382,7 @@ static UniValue getwalletinfo(const JSONRPCRequest& request)
|
|||||||
return NullUniValue;
|
return NullUniValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.fHelp || request.params.size() != 0)
|
const RPCHelpMan help{"getwalletinfo",
|
||||||
throw std::runtime_error(
|
|
||||||
RPCHelpMan{"getwalletinfo",
|
|
||||||
"Returns an object containing various wallet state info.\n",
|
"Returns an object containing various wallet state info.\n",
|
||||||
{},
|
{},
|
||||||
RPCResult{
|
RPCResult{
|
||||||
@ -2408,7 +2406,11 @@ static UniValue getwalletinfo(const JSONRPCRequest& request)
|
|||||||
HelpExampleCli("getwalletinfo", "")
|
HelpExampleCli("getwalletinfo", "")
|
||||||
+ HelpExampleRpc("getwalletinfo", "")
|
+ HelpExampleRpc("getwalletinfo", "")
|
||||||
},
|
},
|
||||||
}.ToString());
|
};
|
||||||
|
|
||||||
|
if (request.fHelp || !help.IsValidNumArgs(request.params.size())) {
|
||||||
|
throw std::runtime_error(help.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure the results are valid at least up to the most recent block
|
// Make sure the results are valid at least up to the most recent block
|
||||||
// the user could have gotten from another RPC command prior to now
|
// the user could have gotten from another RPC command prior to now
|
||||||
|
Loading…
Reference in New Issue
Block a user