Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.h
Show First 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | public: | ||||
bool rejectProof(const ProofId &proofid, | bool rejectProof(const ProofId &proofid, | ||||
RejectionMode mode = RejectionMode::DEFAULT); | RejectionMode mode = RejectionMode::DEFAULT); | ||||
bool exists(const ProofId &proofid) const { | bool exists(const ProofId &proofid) const { | ||||
return getProof(proofid) != nullptr; | return getProof(proofid) != nullptr; | ||||
} | } | ||||
void cleanupDanglingProofs(); | void cleanupDanglingProofs(const ProofRef &localProof); | ||||
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); | ||||
return it != pview.end() && func(*it); | return it != pview.end() && func(*it); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |