From 82a4630061ab6250dbcb9c5d6d482bb2d4c8a56c Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 26 Feb 2018 08:09:26 -0500 Subject: [PATCH] use correct function --- libi2pd/Tunnel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libi2pd/Tunnel.cpp b/libi2pd/Tunnel.cpp index 33a0bffe..73abc1a7 100644 --- a/libi2pd/Tunnel.cpp +++ b/libi2pd/Tunnel.cpp @@ -671,7 +671,8 @@ namespace tunnel if (!tunnel->IsRecreated () && ts + TUNNEL_RECREATION_THRESHOLD > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT) { auto pool = tunnel->GetTunnelPool (); - if (pool && tunnel->GetPeers().size() == pool->GetNumOutboundHops()) + // let it die if the tunnel pool has been reconfigured and this is old + if (pool && tunnel->GetTunnelConfig()->GetNumHops() == pool->GetNumOutboundHops()) { tunnel->SetIsRecreated (); pool->RecreateOutboundTunnel (tunnel); @@ -723,9 +724,9 @@ namespace tunnel { if (!tunnel->IsRecreated () && ts + TUNNEL_RECREATION_THRESHOLD > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT) { - tunnel->SetIsRecreated (); auto pool = tunnel->GetTunnelPool (); - if (pool && tunnel->GetPeers().size() == pool->GetNumInboundHops()) + // let it die if the tunnel pool was reconfigured and has different number of hops + if (pool && tunnel->GetTunnelConfig()->GetNumHops() == pool->GetNumInboundHops()) { tunnel->SetIsRecreated (); pool->RecreateInboundTunnel (tunnel);