From bb33760e877425837a76a19ba1f386fc1a120583 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 26 Feb 2016 16:16:59 -0500 Subject: [PATCH] don't re-request twice --- Streaming.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Streaming.cpp b/Streaming.cpp index 085129bb..46644cb0 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -621,7 +621,7 @@ namespace stream } auto ts = i2p::util::GetMillisecondsSinceEpoch (); - if (!m_CurrentRemoteLease || ts >= m_CurrentRemoteLease->endDate - i2p::tunnel::TUNNEL_EXPIRATION_THRESHOLD*1000) + if (!m_CurrentRemoteLease || ts >= m_CurrentRemoteLease->endDate - i2p::data::LEASE_ENDDATE_THRESHOLD) UpdateCurrentRemoteLease (true); if (m_CurrentRemoteLease && ts < m_CurrentRemoteLease->endDate + i2p::data::LEASE_ENDDATE_THRESHOLD) { @@ -743,8 +743,8 @@ namespace stream if (leases.empty ()) { expired = false; - m_LocalDestination.GetOwner ()->RequestDestination (m_RemoteIdentity->GetIdentHash ()); // time to re-request - leases = m_RemoteLeaseSet->GetNonExpiredLeases (true); // then with threshold + m_LocalDestination.GetOwner ()->RequestDestination (m_RemoteIdentity->GetIdentHash ()); // time to request + leases = m_RemoteLeaseSet->GetNonExpiredLeases (true); // then with threshold } if (!leases.empty ()) { @@ -772,8 +772,7 @@ namespace stream { m_RemoteLeaseSet = nullptr; m_CurrentRemoteLease = nullptr; - // re-request expired - m_LocalDestination.GetOwner ()->RequestDestination (m_RemoteIdentity->GetIdentHash ()); + // we have requested expired before, no need to do it twice } } else