rpc: clarify getblockfrompeer behavior when called multiple times
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -1439,7 +1439,9 @@ bool PeerManagerImpl::FetchBlock(NodeId id, const CBlockIndex& block_index)
|
|||||||
// Ignore pre-segwit peers
|
// Ignore pre-segwit peers
|
||||||
if (!state->fHaveWitness) return false;
|
if (!state->fHaveWitness) return false;
|
||||||
|
|
||||||
// Mark block as in-flight unless it already is
|
// Mark block as in-flight unless it already is (for this peer).
|
||||||
|
// If a block was already in-flight for a different peer, its BLOCKTXN
|
||||||
|
// response will be dropped.
|
||||||
if (!BlockRequested(id, block_index)) return false;
|
if (!BlockRequested(id, block_index)) return false;
|
||||||
|
|
||||||
// Construct message to request the block
|
// Construct message to request the block
|
||||||
|
|||||||
@@ -781,7 +781,8 @@ static RPCHelpMan getblockfrompeer()
|
|||||||
"getblockfrompeer",
|
"getblockfrompeer",
|
||||||
"\nAttempt to fetch block from a given peer.\n"
|
"\nAttempt to fetch block from a given peer.\n"
|
||||||
"\nWe must have the header for this block, e.g. using submitheader.\n"
|
"\nWe must have the header for this block, e.g. using submitheader.\n"
|
||||||
"\nReturns {} if a block-request was successfully scheduled\n",
|
"Subsequent calls for the same block and a new peer will cause the response from the previous peer to be ignored.\n"
|
||||||
|
"\nReturns an empty JSON object if the request was successfully scheduled.",
|
||||||
{
|
{
|
||||||
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
|
{"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)"},
|
{"nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO, "The node ID (see getpeerinfo for node IDs)"},
|
||||||
|
|||||||
Reference in new issue
Block a user