From 5a2b795440ecc90a806ea326ccfb7224f4f6bafe Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 26 Feb 2018 19:41:24 -0500 Subject: [PATCH] fixed crash --- libi2pd/Tunnel.cpp | 4 ++-- libi2pd/Tunnel.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libi2pd/Tunnel.cpp b/libi2pd/Tunnel.cpp index 73abc1a7..c7e1b1b4 100644 --- a/libi2pd/Tunnel.cpp +++ b/libi2pd/Tunnel.cpp @@ -672,7 +672,7 @@ namespace tunnel { auto pool = tunnel->GetTunnelPool (); // let it die if the tunnel pool has been reconfigured and this is old - if (pool && tunnel->GetTunnelConfig()->GetNumHops() == pool->GetNumOutboundHops()) + if (pool && tunnel->GetNumHops() == pool->GetNumOutboundHops()) { tunnel->SetIsRecreated (); pool->RecreateOutboundTunnel (tunnel); @@ -726,7 +726,7 @@ namespace tunnel { auto pool = tunnel->GetTunnelPool (); // let it die if the tunnel pool was reconfigured and has different number of hops - if (pool && tunnel->GetTunnelConfig()->GetNumHops() == pool->GetNumInboundHops()) + if (pool && tunnel->GetNumHops() == pool->GetNumInboundHops()) { tunnel->SetIsRecreated (); pool->RecreateInboundTunnel (tunnel); diff --git a/libi2pd/Tunnel.h b/libi2pd/Tunnel.h index 38beccaa..3244faad 100644 --- a/libi2pd/Tunnel.h +++ b/libi2pd/Tunnel.h @@ -105,6 +105,7 @@ namespace tunnel bool IsFailed () const { return m_State == eTunnelStateFailed; }; bool IsRecreated () const { return m_IsRecreated; }; void SetIsRecreated () { m_IsRecreated = true; }; + int GetNumHops () const { return m_Hops.size (); }; virtual bool IsInbound() const = 0; std::shared_ptr GetTunnelPool () const { return m_Pool; };