Skip to content

Commit

Permalink
merge bitcoin#23702: Add missing optional to getblockfrompeer
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Jun 23, 2024
1 parent 9dfec2d commit a1e80be
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,22 +769,23 @@ static RPCHelpMan getmempoolentry()

static RPCHelpMan getblockfrompeer()
{
return RPCHelpMan{"getblockfrompeer",
"\nAttempt to fetch block from a given peer.\n"
"\nWe must have the header for this block, e.g. using submitheader.\n"
"\nReturns {} if a block-request was successfully scheduled\n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO, "The node ID (see getpeerinfo for node IDs)"},
},
RPCResult{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR, "warnings", "any warnings"}
}},
RPCExamples{
HelpExampleCli("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
+ HelpExampleRpc("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
},
return RPCHelpMan{
"getblockfrompeer",
"\nAttempt to fetch block from a given peer.\n"
"\nWe must have the header for this block, e.g. using submitheader.\n"
"\nReturns {} if a block-request was successfully scheduled\n",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO, "The node ID (see getpeerinfo for node IDs)"},
},
RPCResult{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR, "warnings", /*optional=*/true, "any warnings"},
}},
RPCExamples{
HelpExampleCli("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
+ HelpExampleRpc("getblockfrompeer", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" 0")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
const NodeContext& node = EnsureAnyNodeContext(request.context);
Expand Down

0 comments on commit a1e80be

Please sign in to comment.