1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 04:04:16 +00:00

don't insert same transit tunnel twice

This commit is contained in:
orignal 2015-02-10 09:39:49 -05:00
parent d01f3b094b
commit a3c1c314d0

View File

@ -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 ()