Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.h
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | using QuerySet = boost::multi_index_container< | ||||
// sorted by timeout | // sorted by timeout | ||||
boost::multi_index::ordered_non_unique< | boost::multi_index::ordered_non_unique< | ||||
boost::multi_index::tag<query_timeout>, | boost::multi_index::tag<query_timeout>, | ||||
boost::multi_index::member<Query, TimePoint, | boost::multi_index::member<Query, TimePoint, | ||||
&Query::timeout>>>>; | &Query::timeout>>>>; | ||||
RWCollection<QuerySet> queries; | RWCollection<QuerySet> queries; | ||||
/** The key used to sign responses. */ | /** Data required to participate. */ | ||||
struct PeerData; | |||||
std::unique_ptr<PeerData> peerData; | |||||
CKey sessionKey; | CKey sessionKey; | ||||
/** 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; | ||||
Show All 14 Lines | public: | ||||
void sendResponse(CNode *pfrom, Response response) const; | void sendResponse(CNode *pfrom, Response response) const; | ||||
bool registerVotes(NodeId nodeid, const Response &response, | bool registerVotes(NodeId nodeid, const Response &response, | ||||
std::vector<BlockUpdate> &updates); | std::vector<BlockUpdate> &updates); | ||||
bool addNode(NodeId nodeid, const Proof &proof, | bool addNode(NodeId nodeid, const Proof &proof, | ||||
const Delegation &delegation); | const Delegation &delegation); | ||||
bool forNode(NodeId nodeid, std::function<bool(const Node &n)> func) const; | bool forNode(NodeId nodeid, std::function<bool(const Node &n)> func) const; | ||||
CPubKey getSessionPubKey() const { return sessionKey.GetPubKey(); } | CPubKey getSessionPubKey() const; | ||||
bool startEventLoop(CScheduler &scheduler); | bool startEventLoop(CScheduler &scheduler); | ||||
bool stopEventLoop(); | bool stopEventLoop(); | ||||
private: | private: | ||||
void runEventLoop(); | void runEventLoop(); | ||||
void clearTimedoutRequests(); | void clearTimedoutRequests(); | ||||
std::vector<CInv> getInvsForNextPoll(bool forPoll = true); | std::vector<CInv> getInvsForNextPoll(bool forPoll = true); | ||||
Show All 13 Lines |