Browse Source

fixed potential race condition

gha
orignal 2 months ago
parent
commit
0710f62948
  1. 3
      libi2pd/SSU2.cpp

3
libi2pd/SSU2.cpp

@ -1336,8 +1336,11 @@ namespace transport
// exclude all existing sessions // exclude all existing sessions
excluded.clear (); excluded.clear ();
{
std::lock_guard<std::mutex> l(m_SessionsByRouterHashMutex);
for (const auto& [ident, s] : m_SessionsByRouterHash) for (const auto& [ident, s] : m_SessionsByRouterHash)
excluded.insert (ident); excluded.insert (ident);
}
// sesssion about to expire are not counted // sesssion about to expire are not counted
for (auto i = introducers.size (); i < SSU2_MAX_NUM_INTRODUCERS + numOldSessions; i++) for (auto i = introducers.size (); i < SSU2_MAX_NUM_INTRODUCERS + numOldSessions; i++)

Loading…
Cancel
Save