Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.h
Show First 20 Lines • Show All 122 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: | ||||
/** | /** | ||||
* Peer API. | * Peer API. | ||||
*/ | */ | ||||
PeerId addPeer(uint32_t score) { return addPeer(nextPeerId++, score); } | |||||
// Provide the peer associated toa proof. If the peer does not exists, then | // Provide the peer associated toa proof. If the peer does not exists, then | ||||
// it is created. | // it is created. | ||||
PeerId getPeer(const Proof &proof); | PeerId getPeer(const Proof &proof); | ||||
bool removePeer(const PeerId peerid); | bool removePeer(const PeerId peerid); | ||||
bool rescorePeer(const PeerId peerid, uint32_t score); | bool rescorePeer(const PeerId peerid, uint32_t score); | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |