File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -824,9 +824,7 @@ static CBlock GetBlockChecked(const CBlockIndex* pblockindex)
824
824
825
825
static UniValue getblock (const JSONRPCRequest& request)
826
826
{
827
- if (request.fHelp || request.params .size () < 1 || request.params .size () > 2 )
828
- throw std::runtime_error (
829
- RPCHelpMan{" getblock" ,
827
+ const RPCHelpMan help{" getblock" ,
830
828
" \n If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.\n "
831
829
" If verbosity is 1, returns an Object with information about block <hash>.\n "
832
830
" If verbosity is 2, returns an Object with information about block <hash> and information about each transaction. \n " ,
@@ -878,7 +876,11 @@ static UniValue getblock(const JSONRPCRequest& request)
878
876
HelpExampleCli (" getblock" , " \" 00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" " )
879
877
+ HelpExampleRpc (" getblock" , " \" 00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" " )
880
878
},
881
- }.ToString ());
879
+ };
880
+
881
+ if (request.fHelp || !help.IsValidNumArgs (request.params .size ())) {
882
+ throw std::runtime_error (help.ToString ());
883
+ }
882
884
883
885
LOCK (cs_main);
884
886
You can’t perform that action at this time.
0 commit comments