Call ProcessTick every second, handle tick cooldown inside (#2522)
This commit is contained in:
parent
973a7f6dd6
commit
3a6bd8d235
@ -2078,7 +2078,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
|
||||
if (!fLiteMode) {
|
||||
scheduler.scheduleEvery(boost::bind(&CNetFulfilledRequestManager::DoMaintenance, boost::ref(netfulfilledman)), 60);
|
||||
scheduler.scheduleEvery(boost::bind(&CMasternodeSync::DoMaintenance, boost::ref(masternodeSync), boost::ref(*g_connman)), MASTERNODE_SYNC_TICK_SECONDS);
|
||||
scheduler.scheduleEvery(boost::bind(&CMasternodeSync::DoMaintenance, boost::ref(masternodeSync), boost::ref(*g_connman)), 1);
|
||||
scheduler.scheduleEvery(boost::bind(&CMasternodeMan::DoMaintenance, boost::ref(mnodeman), boost::ref(*g_connman)), 1);
|
||||
scheduler.scheduleEvery(boost::bind(&CActiveLegacyMasternodeManager::DoMaintenance, boost::ref(legacyActiveMasternodeManager), boost::ref(*g_connman)), MASTERNODE_MIN_MNP_SECONDS);
|
||||
|
||||
|
@ -150,6 +150,12 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
|
||||
nTimeLastProcess = GetTime();
|
||||
return;
|
||||
}
|
||||
|
||||
if(GetTime() - nTimeLastProcess < MASTERNODE_SYNC_TICK_SECONDS) {
|
||||
// too early, nothing to do here
|
||||
return;
|
||||
}
|
||||
|
||||
nTimeLastProcess = GetTime();
|
||||
|
||||
// reset sync status in case of any other sync failure
|
||||
|
Loading…
Reference in New Issue
Block a user