Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.h
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | void forEachNode(const Peer &peer, Callable &&func) const { | ||||
func(*it); | func(*it); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Proof and Peer related API. | * Proof and Peer related API. | ||||
*/ | */ | ||||
bool registerProof(const ProofRef &proof); | bool registerProof(const ProofRef &proof); | ||||
bool rejectProof(const ProofId &proofid); | |||||
bool exists(const ProofId &proofid) const { | bool exists(const ProofId &proofid) const { | ||||
return getProof(proofid) != nullptr; | return getProof(proofid) != nullptr; | ||||
} | } | ||||
template <typename Callable> | template <typename Callable> | ||||
bool forPeer(const ProofId &proofid, Callable &&func) const { | bool forPeer(const ProofId &proofid, Callable &&func) const { | ||||
auto &pview = peers.get<by_proofid>(); | auto &pview = peers.get<by_proofid>(); | ||||
auto it = pview.find(proofid); | auto it = pview.find(proofid); | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |