mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#23706: rpc: getblockfrompeer followups
923312fbf6rpc: use peer_id, block_hash for FetchBlock (Sjors Provoost)34d5399211rpc: more detailed errors for getblockfrompeer (Sjors Provoost)60243cac72rpc: turn already downloaded into error in getblockfrompeer (Sjors Provoost)809d66bb65rpc: clarify getblockfrompeer behavior when called multiple times (Sjors Provoost)0e3d7c5ee1refactor: drop redundant hash argument from FetchBlock (Sjors Provoost)8d1a3e6498rpc: allow empty JSON object result (Sjors Provoost)bfbf91d0b2test: fancier Python for getblockfrompeer (Sjors Provoost) Pull request description: Followups from #20295. ACKs for top commit: jonatack: ACK923312fbf6📦 fjahr: tested ACK923312fbf6Tree-SHA512: da9eca76e302e249409c9d7f0d16cca668ed981e2ab6ca2d1743dad0d830b94b1bc5ffb9028a00764b863201945c273cc8f4409a4c9ca3817830007dffa2bc20
This commit is contained in:
@@ -45,12 +45,11 @@ public:
|
||||
/**
|
||||
* Attempt to manually fetch block from a given peer. We must already have the header.
|
||||
*
|
||||
* @param[in] id The peer id
|
||||
* @param[in] hash The block hash
|
||||
* @param[in] pindex The blockindex
|
||||
* @returns Whether a request was successfully made
|
||||
* @param[in] peer_id The peer id
|
||||
* @param[in] block_index The blockindex
|
||||
* @returns std::nullopt if a request was successfully made, otherwise an error message
|
||||
*/
|
||||
virtual bool FetchBlock(NodeId id, const uint256& hash, const CBlockIndex& pindex) = 0;
|
||||
virtual std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index) = 0;
|
||||
|
||||
/** Begin running background tasks, should only be called once */
|
||||
virtual void StartScheduledTasks(CScheduler& scheduler) = 0;
|
||||
|
||||
Reference in New Issue
Block a user