Skip to content

Commit 7e5cc5e

Browse files
committed
merge bitcoin#23702: Add missing optional to getblockfrompeer
1 parent c294457 commit 7e5cc5e

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
@@ -769,22 +769,23 @@ static RPCHelpMan getmempoolentry()
769769

770770
static RPCHelpMan getblockfrompeer()
771771
{
772-
return RPCHelpMan{"getblockfrompeer",
773-
"\nAttempt to fetch block from a given peer.\n"
774-
"\nWe must have the header for this block, e.g. using submitheader.\n"
775-
"\nReturns {} if a block-request was successfully scheduled\n",
776-
{
777-
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
778-
{"nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO, "The node ID (see getpeerinfo for node IDs)"},
779-
},
780-
RPCResult{RPCResult::Type::OBJ, "", "",
781-
{
782-
{RPCResult::Type::STR, "warnings", "any warnings"}
783-
}},
784-
RPCExamples{
785-
HelpExampleCli("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
786-
+ HelpExampleRpc("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
787-
},
772+
return RPCHelpMan{
773+
"getblockfrompeer",
774+
"\nAttempt to fetch block from a given peer.\n"
775+
"\nWe must have the header for this block, e.g. using submitheader.\n"
776+
"\nReturns {} if a block-request was successfully scheduled\n",
777+
{
778+
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
779+
{"nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO, "The node ID (see getpeerinfo for node IDs)"},
780+
},
781+
RPCResult{RPCResult::Type::OBJ, "", "",
782+
{
783+
{RPCResult::Type::STR, "warnings", /*optional=*/true, "any warnings"},
784+
}},
785+
RPCExamples{
786+
HelpExampleCli("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
787+
+ HelpExampleRpc("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
788+
},
788789
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
789790
{
790791
const NodeContext& node = EnsureAnyNodeContext(request.context);

0 commit comments

Comments
 (0)