@@ -676,18 +676,10 @@ void CSigSharesManager::ProcessSigShare(NodeId nodeId, const CSigShare& sigShare
676676 if (!sigShares.Add (sigShare.GetKey (), sigShare)) {
677677 return ;
678678 }
679-
680679 sigSharesToAnnounce.Add (sigShare.GetKey (), true );
681680
682- auto it = timeSeenForSessions.find (sigShare.GetSignHash ());
683- if (it == timeSeenForSessions.end ()) {
684- auto t = GetTimeMillis ();
685- // insert first-seen and last-seen time
686- timeSeenForSessions.emplace (sigShare.GetSignHash (), std::make_pair (t, t));
687- } else {
688- // update last-seen time
689- it->second .second = GetTimeMillis ();
690- }
681+ // Update the time we've seen the last sigShare
682+ timeSeenForSessions[sigShare.GetSignHash ()] = GetTimeMillis ();
691683
692684 if (!quorumNodes.empty ()) {
693685 // don't announce and wait for other nodes to request this share and directly send it to them
@@ -1215,10 +1207,9 @@ void CSigSharesManager::Cleanup()
12151207 std::unordered_set<uint256, StaticSaltedHasher> timeoutSessions;
12161208 for (auto & p : timeSeenForSessions) {
12171209 auto & signHash = p.first ;
1218- int64_t firstSeenTime = p.second .first ;
1219- int64_t lastSeenTime = p.second .second ;
1210+ int64_t lastSeenTime = p.second ;
12201211
1221- if (now - firstSeenTime >= SESSION_TOTAL_TIMEOUT || now - lastSeenTime >= SESSION_NEW_SHARES_TIMEOUT) {
1212+ if (now - lastSeenTime >= SESSION_NEW_SHARES_TIMEOUT) {
12221213 timeoutSessions.emplace (signHash);
12231214 }
12241215 }
0 commit comments