@@ -675,18 +675,10 @@ void CSigSharesManager::ProcessSigShare(NodeId nodeId, const CSigShare& sigShare
675675 if (!sigShares.Add (sigShare.GetKey (), sigShare)) {
676676 return ;
677677 }
678-
679678 sigSharesToAnnounce.Add (sigShare.GetKey (), true );
680679
681- auto it = timeSeenForSessions.find (sigShare.GetSignHash ());
682- if (it == timeSeenForSessions.end ()) {
683- auto t = GetTimeMillis ();
684- // insert first-seen and last-seen time
685- timeSeenForSessions.emplace (sigShare.GetSignHash (), std::make_pair (t, t));
686- } else {
687- // update last-seen time
688- it->second .second = GetTimeMillis ();
689- }
680+ // Update the time we've seen the last sigShare
681+ timeSeenForSessions[sigShare.GetSignHash ()] = GetTimeMillis ();
690682
691683 if (!quorumNodes.empty ()) {
692684 // don't announce and wait for other nodes to request this share and directly send it to them
@@ -1214,10 +1206,9 @@ void CSigSharesManager::Cleanup()
12141206 std::unordered_set<uint256, StaticSaltedHasher> timeoutSessions;
12151207 for (auto & p : timeSeenForSessions) {
12161208 auto & signHash = p.first ;
1217- int64_t firstSeenTime = p.second .first ;
1218- int64_t lastSeenTime = p.second .second ;
1209+ int64_t lastSeenTime = p.second ;
12191210
1220- if (now - firstSeenTime >= SESSION_TOTAL_TIMEOUT || now - lastSeenTime >= SESSION_NEW_SHARES_TIMEOUT) {
1211+ if (now - lastSeenTime >= SESSION_NEW_SHARES_TIMEOUT) {
12211212 timeoutSessions.emplace (signHash);
12221213 }
12231214 }
0 commit comments