Skip to content

Commit aaaa34e

Browse files
author
MarcoFalke
committed
doc: Add missing optional to getblockfrompeer
1 parent f601326 commit aaaa34e

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

src/rpc/blockchain.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -777,22 +777,23 @@ static RPCHelpMan getmempoolentry()
777777

778778
static RPCHelpMan getblockfrompeer()
779779
{
780-
return RPCHelpMan{"getblockfrompeer",
781-
"\nAttempt to fetch block from a given peer.\n"
782-
"\nWe must have the header for this block, e.g. using submitheader.\n"
783-
"\nReturns {} if a block-request was successfully scheduled\n",
784-
{
785-
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
786-
{"nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO, "The node ID (see getpeerinfo for node IDs)"},
787-
},
788-
RPCResult{RPCResult::Type::OBJ, "", "",
789-
{
790-
{RPCResult::Type::STR, "warnings", "any warnings"}
791-
}},
792-
RPCExamples{
793-
HelpExampleCli("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
794-
+ HelpExampleRpc("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
795-
},
780+
return RPCHelpMan{
781+
"getblockfrompeer",
782+
"\nAttempt to fetch block from a given peer.\n"
783+
"\nWe must have the header for this block, e.g. using submitheader.\n"
784+
"\nReturns {} if a block-request was successfully scheduled\n",
785+
{
786+
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
787+
{"nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO, "The node ID (see getpeerinfo for node IDs)"},
788+
},
789+
RPCResult{RPCResult::Type::OBJ, "", "",
790+
{
791+
{RPCResult::Type::STR, "warnings", /*optional=*/true, "any warnings"},
792+
}},
793+
RPCExamples{
794+
HelpExampleCli("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
795+
+ HelpExampleRpc("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
796+
},
796797
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
797798
{
798799
const NodeContext& node = EnsureAnyNodeContext(request.context);

0 commit comments

Comments
 (0)