Skip to content

Commit

Permalink
use correct function
Browse files Browse the repository at this point in the history
  • Loading branch information
majestrate committed Feb 26, 2018
1 parent 0f77b48 commit 82a4630
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libi2pd/Tunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 82a4630

Please sign in to comment.