Browse Source

don't insert same transit tunnel twice

pull/158/head
orignal 10 years ago
parent
commit
a3c1c314d0
  1. 6
      Tunnel.cpp

6
Tunnel.cpp

@ -317,7 +317,11 @@ namespace tunnel @@ -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…
Cancel
Save