rpc: more detailed errors for getblockfrompeer

This commit is contained in:
Sjors Provoost
2021-12-08 20:16:36 +07:00
parent 60243cac72
commit 34d5399211
4 changed files with 17 additions and 26 deletions

View File

@@ -47,9 +47,9 @@ public:
*
* @param[in] id The peer id
* @param[in] block_index The blockindex
* @returns Whether a request was successfully made
* @returns std::nullopt if a request was successfully made, otherwise an error message
*/
virtual bool FetchBlock(NodeId id, const CBlockIndex& block_index) = 0;
virtual std::optional<std::string> FetchBlock(NodeId id, const CBlockIndex& block_index) = 0;
/** Begin running background tasks, should only be called once */
virtual void StartScheduledTasks(CScheduler& scheduler) = 0;