Skip to content

Commit 577bd51

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#23702: doc: Add missing optional to getblockfrompeer
aaaa34e doc: Add missing optional to getblockfrompeer (MarcoFalke) Pull request description: Can be reviewed with `--word-diff-regex=. --ignore-all-space` ACKs for top commit: Sjors: utACK aaaa34e Tree-SHA512: 7f46c82a46b8cc19f7eb549b9aa13be8cd6849a8ef8a2ddda6d1eee6978d099fccadd29a2bf817f44d601b905f5d5f6b5d8f4f54be5ee8b914b520359c058e68
2 parents b692e61 + aaaa34e commit 577bd51

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)