mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Add util::Expected (std::expected)
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <node/txorphanage.h>
|
||||
#include <protocol.h>
|
||||
#include <threadsafety.h>
|
||||
#include <util/expected.h>
|
||||
#include <validationinterface.h>
|
||||
|
||||
#include <atomic>
|
||||
@@ -101,9 +102,8 @@ public:
|
||||
*
|
||||
* @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 std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index) = 0;
|
||||
virtual util::Expected<void, 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