Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.h
Show First 20 Lines • Show All 207 Lines • ▼ Show 20 Lines | public: | ||||
std::shared_ptr<Proof> getOrphan(const ProofId &id) const; | std::shared_ptr<Proof> getOrphan(const ProofId &id) const; | ||||
void addUnbroadcastProof(const ProofId &proofid); | void addUnbroadcastProof(const ProofId &proofid); | ||||
void removeUnbroadcastProof(const ProofId &proofid); | void removeUnbroadcastProof(const ProofId &proofid); | ||||
void broadcastProofs(const CConnman &connman); | void broadcastProofs(const CConnman &connman); | ||||
private: | private: | ||||
PeerSet::iterator fetchOrCreatePeer(const std::shared_ptr<Proof> &proof); | PeerSet::iterator fetchOrCreatePeer(const std::shared_ptr<Proof> &proof); | ||||
bool addOrUpdateNode(const PeerSet::iterator &it, NodeId nodeid, | bool addOrUpdateNode(const PeerSet::iterator &it, NodeId nodeid); | ||||
CPubKey pubkey); | |||||
bool addNodeToPeer(const PeerSet::iterator &it); | bool addNodeToPeer(const PeerSet::iterator &it); | ||||
bool removeNodeFromPeer(const PeerSet::iterator &it, uint32_t count = 1); | bool removeNodeFromPeer(const PeerSet::iterator &it, uint32_t count = 1); | ||||
}; | }; | ||||
/** | /** | ||||
* This is an internal method that is exposed for testing purposes. | * This is an internal method that is exposed for testing purposes. | ||||
*/ | */ | ||||
PeerId selectPeerImpl(const std::vector<Slot> &slots, const uint64_t slot, | PeerId selectPeerImpl(const std::vector<Slot> &slots, const uint64_t slot, | ||||
const uint64_t max); | const uint64_t max); | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_PEERMANAGER_H | #endif // BITCOIN_AVALANCHE_PEERMANAGER_H |