@@ -930,6 +930,20 @@ void CSigSharesManager::Cleanup()
930
930
{
931
931
LOCK (cs);
932
932
933
+ // Remove sessions which were successfully recovered
934
+ std::unordered_set<uint256> doneSessions;
935
+ sigShares.ForEach ([&](const SigShareKey& k, const CSigShare& sigShare) {
936
+ if (doneSessions.count (sigShare.GetSignHash ())) {
937
+ return ;
938
+ }
939
+ if (quorumSigningManager->HasRecoveredSigForSession (sigShare.GetSignHash ())) {
940
+ doneSessions.emplace (sigShare.GetSignHash ());
941
+ }
942
+ });
943
+ for (auto & signHash : doneSessions) {
944
+ RemoveSigSharesForSession (signHash);
945
+ }
946
+
933
947
// Remove sessions which timed out
934
948
std::unordered_set<uint256> timeoutSessions;
935
949
for (auto & p : firstSeenForSessions) {
@@ -957,20 +971,6 @@ void CSigSharesManager::Cleanup()
957
971
RemoveSigSharesForSession (signHash);
958
972
}
959
973
960
- // Remove sessions which were successfully recovered
961
- std::unordered_set<uint256> doneSessions;
962
- sigShares.ForEach ([&](const SigShareKey& k, const CSigShare& sigShare) {
963
- if (doneSessions.count (sigShare.GetSignHash ())) {
964
- return ;
965
- }
966
- if (quorumSigningManager->HasRecoveredSigForSession (sigShare.GetSignHash ())) {
967
- doneSessions.emplace (sigShare.GetSignHash ());
968
- }
969
- });
970
- for (auto & signHash : doneSessions) {
971
- RemoveSigSharesForSession (signHash);
972
- }
973
-
974
974
sigShares.ForEach ([&](const SigShareKey& k, const CSigShare& sigShare) {
975
975
quorumsToCheck.emplace ((Consensus::LLMQType)sigShare.llmqType , sigShare.quorumHash );
976
976
});
0 commit comments