diff --git a/Destination.cpp b/Destination.cpp index 5e76f770..8e13db42 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -198,7 +198,7 @@ namespace client else { auto ls = i2p::data::netdb.FindLeaseSet (ident); - if (ls) + if (ls && !ls->IsExpired ()) { ls->PopulateLeases (); // since we don't store them in netdb m_RemoteLeaseSets[ident] = ls; diff --git a/Streaming.cpp b/Streaming.cpp index 7047c1fb..79f202be 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) UpdateCurrentRemoteLease (true); - if (m_CurrentRemoteLease && ts < m_CurrentRemoteLease->endDate) + if (m_CurrentRemoteLease && ts < m_CurrentRemoteLease->endDate + i2p::data::LEASE_ENDDATE_THRESHOLD) { std::vector<i2p::tunnel::TunnelMessageBlock> msgs; for (auto it: packets)