Cleanup successful sessions before doing timeout check (#2712)
Otherwise we get some false-positive timeout messages in logs.
This commit is contained in:
parent
26db020d17
commit
104c6e7767
@ -942,6 +942,20 @@ void CSigSharesManager::Cleanup()
|
||||
{
|
||||
LOCK(cs);
|
||||
|
||||
// Remove sessions which were succesfully recovered
|
||||
std::unordered_set<uint256> doneSessions;
|
||||
sigShares.ForEach([&](const SigShareKey& k, const CSigShare& sigShare) {
|
||||
if (doneSessions.count(sigShare.GetSignHash())) {
|
||||
return;
|
||||
}
|
||||
if (quorumSigningManager->HasRecoveredSigForSession(sigShare.GetSignHash())) {
|
||||
doneSessions.emplace(sigShare.GetSignHash());
|
||||
}
|
||||
});
|
||||
for (auto& signHash : doneSessions) {
|
||||
RemoveSigSharesForSession(signHash);
|
||||
}
|
||||
|
||||
// Remove sessions which timed out
|
||||
std::unordered_set<uint256> timeoutSessions;
|
||||
for (auto& p : firstSeenForSessions) {
|
||||
@ -969,20 +983,6 @@ void CSigSharesManager::Cleanup()
|
||||
RemoveSigSharesForSession(signHash);
|
||||
}
|
||||
|
||||
// Remove sessions which were succesfully recovered
|
||||
std::unordered_set<uint256> doneSessions;
|
||||
sigShares.ForEach([&](const SigShareKey& k, const CSigShare& sigShare) {
|
||||
if (doneSessions.count(sigShare.GetSignHash())) {
|
||||
return;
|
||||
}
|
||||
if (quorumSigningManager->HasRecoveredSigForSession(sigShare.GetSignHash())) {
|
||||
doneSessions.emplace(sigShare.GetSignHash());
|
||||
}
|
||||
});
|
||||
for (auto& signHash : doneSessions) {
|
||||
RemoveSigSharesForSession(signHash);
|
||||
}
|
||||
|
||||
sigShares.ForEach([&](const SigShareKey& k, const CSigShare& sigShare) {
|
||||
quorumsToCheck.emplace((Consensus::LLMQType) sigShare.llmqType, sigShare.quorumHash);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user