Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.h
Show First 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | public: | ||||
*/ | */ | ||||
bool addNode(NodeId nodeid, const ProofId &proofid); | bool addNode(NodeId nodeid, const ProofId &proofid); | ||||
bool removeNode(NodeId nodeid); | bool removeNode(NodeId nodeid); | ||||
size_t getNodeCount() const { return nodes.size(); } | size_t getNodeCount() const { return nodes.size(); } | ||||
size_t getPendingNodeCount() const { return pendingNodes.size(); } | size_t getPendingNodeCount() const { return pendingNodes.size(); } | ||||
// Update when a node is to be polled next. | // Update when a node is to be polled next. | ||||
bool updateNextRequestTime(NodeId nodeid, TimePoint timeout); | bool updateNextRequestTime(NodeId nodeid, TimePoint timeout); | ||||
/** | |||||
* Flag that a node did send its compact proofs. | |||||
* @return True if the flag changed state, i;e. if this is the first time | |||||
* the message is accounted for this node. | |||||
*/ | |||||
bool latchAvaproofsSent(NodeId nodeid); | |||||
// Randomly select a node to poll. | // Randomly select a node to poll. | ||||
NodeId selectNode(); | NodeId selectNode(); | ||||
/** | /** | ||||
* Returns true if we encountered a lack of node since the last call. | * Returns true if we encountered a lack of node since the last call. | ||||
*/ | */ | ||||
bool shouldRequestMoreNodes() { return needMoreNodes.exchange(false); } | bool shouldRequestMoreNodes() { return needMoreNodes.exchange(false); } | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |