refactor: immediately update lastCleanupTime

This commit is contained in:
pasta 2024-04-22 10:04:52 -05:00
parent d0d2641154
commit 04ba164064
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -619,6 +619,7 @@ void CChainLocksHandler::Cleanup()
if (GetTimeMillis() - lastCleanupTime < CLEANUP_INTERVAL) { if (GetTimeMillis() - lastCleanupTime < CLEANUP_INTERVAL) {
return; return;
} }
lastCleanupTime = GetTimeMillis();
{ {
LOCK(cs); LOCK(cs);
@ -665,8 +666,6 @@ void CChainLocksHandler::Cleanup()
++it; ++it;
} }
} }
lastCleanupTime = GetTimeMillis();
} }
bool AreChainLocksEnabled(const CSporkManager& sporkman) bool AreChainLocksEnabled(const CSporkManager& sporkman)