mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-16 00:12:43 +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)
|
void Tunnels::AddTransitTunnel (TransitTunnel * tunnel)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_TransitTunnelsMutex);
|
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 ()
|
void Tunnels::Start ()
|
||||||
|
Loading…
Reference in New Issue
Block a user