rpc: getblockfrompeer

Co-authored-by: John Newbery <john@johnnewbery.com>
This commit is contained in:
Sjors Provoost
2021-05-13 18:51:47 +02:00
parent b884ababc2
commit dce8c4c381
8 changed files with 181 additions and 0 deletions

View File

@@ -42,6 +42,16 @@ public:
CTxMemPool& pool, bool ignore_incoming_txs);
virtual ~PeerManager() { }
/**
* 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
*/
virtual bool FetchBlock(NodeId id, const uint256& hash, const CBlockIndex& pindex) = 0;
/** Begin running background tasks, should only be called once */
virtual void StartScheduledTasks(CScheduler& scheduler) = 0;