mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
RPC: Switch getblockfrompeer back to standard param name blockhash
This commit partially reverts 923312fbf6
.
This commit is contained in:
parent
38d3d0bfc4
commit
88917f93cc
1 changed files with 2 additions and 2 deletions
|
@ -430,7 +430,7 @@ static RPCHelpMan getblockfrompeer()
|
||||||
"Subsequent calls for the same block and a new peer will cause the response from the previous peer to be ignored.\n\n"
|
"Subsequent calls for the same block and a new peer will cause the response from the previous peer to be ignored.\n\n"
|
||||||
"Returns an empty JSON object if the request was successfully scheduled.",
|
"Returns an empty JSON object if the request was successfully scheduled.",
|
||||||
{
|
{
|
||||||
{"block_hash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash to try to fetch"},
|
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash to try to fetch"},
|
||||||
{"peer_id", RPCArg::Type::NUM, RPCArg::Optional::NO, "The peer to fetch it from (see getpeerinfo for peer IDs)"},
|
{"peer_id", RPCArg::Type::NUM, RPCArg::Optional::NO, "The peer to fetch it from (see getpeerinfo for peer IDs)"},
|
||||||
},
|
},
|
||||||
RPCResult{RPCResult::Type::OBJ, "", /*optional=*/false, "", {}},
|
RPCResult{RPCResult::Type::OBJ, "", /*optional=*/false, "", {}},
|
||||||
|
@ -444,7 +444,7 @@ static RPCHelpMan getblockfrompeer()
|
||||||
ChainstateManager& chainman = EnsureChainman(node);
|
ChainstateManager& chainman = EnsureChainman(node);
|
||||||
PeerManager& peerman = EnsurePeerman(node);
|
PeerManager& peerman = EnsurePeerman(node);
|
||||||
|
|
||||||
const uint256& block_hash{ParseHashV(request.params[0], "block_hash")};
|
const uint256& block_hash{ParseHashV(request.params[0], "blockhash")};
|
||||||
const NodeId peer_id{request.params[1].get_int64()};
|
const NodeId peer_id{request.params[1].get_int64()};
|
||||||
|
|
||||||
const CBlockIndex* const index = WITH_LOCK(cs_main, return chainman.m_blockman.LookupBlockIndex(block_hash););
|
const CBlockIndex* const index = WITH_LOCK(cs_main, return chainman.m_blockman.LookupBlockIndex(block_hash););
|
||||||
|
|
Loading…
Add table
Reference in a new issue