Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.h
Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Lines | class Processor { | ||||
/** 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 | |||||
* after IBD | |||||
*/ | |||||
bool mustRegisterProof = false; | |||||
Processor(interfaces::Chain &chain, CConnman *connmanIn, | Processor(interfaces::Chain &chain, CConnman *connmanIn, | ||||
NodePeerManager *nodePeerManagerIn, | NodePeerManager *nodePeerManagerIn, | ||||
std::unique_ptr<PeerData> peerDataIn, CKey sessionKeyIn); | std::unique_ptr<PeerData> peerDataIn, CKey sessionKeyIn); | ||||
public: | public: | ||||
~Processor(); | ~Processor(); | ||||
static std::unique_ptr<Processor> | static std::unique_ptr<Processor> | ||||
Show All 20 Lines | public: | ||||
CPubKey getSessionPubKey() const; | CPubKey getSessionPubKey() const; | ||||
bool sendHello(CNode *pfrom) const; | bool sendHello(CNode *pfrom) const; | ||||
bool addProof(const std::shared_ptr<Proof> &proof); | bool addProof(const std::shared_ptr<Proof> &proof); | ||||
std::shared_ptr<Proof> getProof(const ProofId &proofid) const; | std::shared_ptr<Proof> getProof(const ProofId &proofid) const; | ||||
std::shared_ptr<Proof> getLocalProof() const; | std::shared_ptr<Proof> getLocalProof() const; | ||||
Peer::Timestamp getProofTime(const ProofId &proofid) const; | Peer::Timestamp getProofTime(const ProofId &proofid) const; | ||||
std::shared_ptr<Proof> getOrphan(const ProofId &proofid) const; | std::shared_ptr<Proof> getOrphan(const ProofId &proofid) const; | ||||
bool registerLocalProof(); | |||||
/* | /* | ||||
* Return whether the avalanche service flag should be set. | * Return whether the avalanche service flag should be set. | ||||
*/ | */ | ||||
bool isAvalancheServiceAvailable() { return !!peerData; } | bool isAvalancheServiceAvailable() { return !!peerData; } | ||||
std::vector<avalanche::Peer> getPeers() const; | std::vector<avalanche::Peer> getPeers() const; | ||||
std::vector<NodeId> getNodeIdsForPeer(PeerId peerId) const; | std::vector<NodeId> getNodeIdsForPeer(PeerId peerId) const; | ||||
Show All 26 Lines |