Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.h
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | class PeerManager { | ||||
static constexpr int SELECT_PEER_MAX_RETRY = 3; | static constexpr int SELECT_PEER_MAX_RETRY = 3; | ||||
static constexpr int SELECT_NODE_MAX_RETRY = 3; | static constexpr int SELECT_NODE_MAX_RETRY = 3; | ||||
public: | public: | ||||
/** | /** | ||||
* Node API. | * Node API. | ||||
*/ | */ | ||||
bool addNode(NodeId nodeid, const std::shared_ptr<Proof> &proof, | bool addNode(NodeId nodeid, const Delegation &delegation); | ||||
const Delegation &delegation); | |||||
bool removeNode(NodeId nodeid); | bool removeNode(NodeId nodeid); | ||||
bool forNode(NodeId nodeid, std::function<bool(const Node &n)> func) const; | bool forNode(NodeId nodeid, std::function<bool(const Node &n)> func) const; | ||||
bool updateNextRequestTime(NodeId nodeid, TimePoint timeout); | bool updateNextRequestTime(NodeId nodeid, TimePoint timeout); | ||||
/** | /** | ||||
* Randomly select a node to poll. | * Randomly select a node to poll. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |