Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | : connman(connmanIn), chainman(chainmanIn), | ||||
staleVoteThreshold(staleVoteThresholdIn), | staleVoteThreshold(staleVoteThresholdIn), | ||||
staleVoteFactor(staleVoteFactorIn) { | staleVoteFactor(staleVoteFactorIn) { | ||||
// Make sure we get notified of chain state changes. | // Make sure we get notified of chain state changes. | ||||
chainNotificationsHandler = | chainNotificationsHandler = | ||||
chain.handleNotifications(std::make_shared<NotificationsHandler>(this)); | chain.handleNotifications(std::make_shared<NotificationsHandler>(this)); | ||||
scheduler.scheduleEvery( | scheduler.scheduleEvery( | ||||
[this]() -> bool { | [this]() -> bool { | ||||
WITH_LOCK(cs_peerManager, peerManager->cleanupDanglingProofs()); | WITH_LOCK(cs_peerManager, | ||||
peerManager->cleanupDanglingProofs( | |||||
peerData ? peerData->proof : ProofRef())); | |||||
return true; | return true; | ||||
}, | }, | ||||
5min); | 5min); | ||||
} | } | ||||
Processor::~Processor() { | Processor::~Processor() { | ||||
chainNotificationsHandler.reset(); | chainNotificationsHandler.reset(); | ||||
stopEventLoop(); | stopEventLoop(); | ||||
▲ Show 20 Lines • Show All 791 Lines • Show Last 20 Lines |