mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
don't insert same transit tunnel twice
This commit is contained in:
parent
d01f3b094b
commit
a3c1c314d0
@ -317,7 +317,11 @@ namespace tunnel
|
||||
void Tunnels::AddTransitTunnel (TransitTunnel * tunnel)
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_TransitTunnelsMutex);
|
||||
m_TransitTunnels[tunnel->GetTunnelID ()] = tunnel;
|
||||
if (!m_TransitTunnels.insert (std::make_pair (tunnel->GetTunnelID (), tunnel)).second)
|
||||
{
|
||||
LogPrint (eLogError, "Transit tunnel ", tunnel->GetTunnelID (), " already exists");
|
||||
delete tunnel;
|
||||
}
|
||||
}
|
||||
|
||||
void Tunnels::Start ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user