Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.h
Show All 22 Lines | |||||
#include <atomic> | #include <atomic> | ||||
#include <chrono> | #include <chrono> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <memory> | #include <memory> | ||||
#include <optional> | #include <optional> | ||||
#include <vector> | #include <vector> | ||||
class ArgsManager; | |||||
class Config; | class Config; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class CScheduler; | class CScheduler; | ||||
class PeerManager; | class PeerManager; | ||||
using NodePeerManager = PeerManager; | using NodePeerManager = PeerManager; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | class Processor { | ||||
RWCollection<QuerySet> queries; | RWCollection<QuerySet> queries; | ||||
/** Data required to participate. */ | /** Data required to participate. */ | ||||
struct PeerData { | struct PeerData { | ||||
std::optional<Proof> proof; | std::optional<Proof> proof; | ||||
std::optional<Delegation> delegation; | std::optional<Delegation> delegation; | ||||
CKey sessionKey; | CKey sessionKey; | ||||
static PeerData FromArgs(const ArgsManager &argsman); | |||||
}; | }; | ||||
PeerData peerData; | PeerData peerData; | ||||
/** Event loop machinery. */ | /** Event loop machinery. */ | ||||
EventLoop eventLoop; | EventLoop eventLoop; | ||||
/** Registered interfaces::Chain::Notifications handler. */ | /** Registered interfaces::Chain::Notifications handler. */ | ||||
class NotificationsHandler; | class NotificationsHandler; | ||||
std::unique_ptr<interfaces::Handler> chainNotificationsHandler; | std::unique_ptr<interfaces::Handler> chainNotificationsHandler; | ||||
/** | /** | ||||
* Flag indicating that the proof must be registered at first new block | * Flag indicating that the proof must be registered at first new block | ||||
* after IBD | * after IBD | ||||
*/ | */ | ||||
bool mustRegisterProof = false; | bool mustRegisterProof = false; | ||||
public: | public: | ||||
Processor(interfaces::Chain &chain, CConnman *connmanIn, | Processor(interfaces::Chain &chain, CConnman *connmanIn, | ||||
NodePeerManager *nodePeerManagerIn); | NodePeerManager *nodePeerManagerIn); | ||||
Processor(interfaces::Chain &chain, CConnman *connmanIn, | |||||
NodePeerManager *nodePeerManagerIn, const ArgsManager &argsman); | |||||
~Processor(); | ~Processor(); | ||||
void setQueryTimeoutDuration(std::chrono::milliseconds d) { | void setQueryTimeoutDuration(std::chrono::milliseconds d) { | ||||
queryTimeoutDuration = d; | queryTimeoutDuration = d; | ||||
} | } | ||||
bool addBlockToReconcile(const CBlockIndex *pindex); | bool addBlockToReconcile(const CBlockIndex *pindex); | ||||
bool isAccepted(const CBlockIndex *pindex) const; | bool isAccepted(const CBlockIndex *pindex) const; | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |