mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-03 13:44:42 -05:00
doc: Add missing optional to getblockfrompeer
This commit is contained in:
parent
f6013265b7
commit
aaaa34e34d
1 changed files with 17 additions and 16 deletions
|
@ -777,22 +777,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);
|
||||
|
|
Loading…
Add table
Reference in a new issue