1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-19 01:09:58 +00:00

don't delete new session with same router hash from sessions-by-hash table

This commit is contained in:
orignal 2024-03-15 20:12:47 -04:00
parent f2085ecc8d
commit 161ff3579b

View File

@ -436,7 +436,11 @@ namespace transport
{
auto ident = it->second->GetRemoteIdentity ();
if (ident)
m_SessionsByRouterHash.erase (ident->GetIdentHash ());
{
auto it1 = m_SessionsByRouterHash.find (ident->GetIdentHash ());
if (it1 != m_SessionsByRouterHash.end () && it->second == it1->second)
m_SessionsByRouterHash.erase (it1);
}
if (m_LastSession == it->second)
m_LastSession = nullptr;
m_Sessions.erase (it);