Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.cpp
Show First 20 Lines • Show All 789 Lines • ▼ Show 20 Lines | if (isBoundToPeer(proofid)) { | ||||
m_unbroadcast_proofids.insert(proofid); | m_unbroadcast_proofids.insert(proofid); | ||||
} | } | ||||
} | } | ||||
void PeerManager::removeUnbroadcastProof(const ProofId &proofid) { | void PeerManager::removeUnbroadcastProof(const ProofId &proofid) { | ||||
m_unbroadcast_proofids.erase(proofid); | m_unbroadcast_proofids.erase(proofid); | ||||
} | } | ||||
void PeerManager::cleanup() { | |||||
auto now = GetTime<std::chrono::seconds>(); | |||||
// Cleanup the orphan proofs. Consider obsolete any proof that has been | |||||
// registered more than 30 minutes ago. | |||||
orphanProofPool.removeObsoleteProofs(std::max(0s, now - 30min)); | |||||
} | |||||
} // namespace avalanche | } // namespace avalanche |