mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
count lease expiration threshold
This commit is contained in:
parent
333103f50e
commit
c561d71dc0
@ -198,7 +198,7 @@ namespace client
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto ls = i2p::data::netdb.FindLeaseSet (ident);
|
auto ls = i2p::data::netdb.FindLeaseSet (ident);
|
||||||
if (ls)
|
if (ls && !ls->IsExpired ())
|
||||||
{
|
{
|
||||||
ls->PopulateLeases (); // since we don't store them in netdb
|
ls->PopulateLeases (); // since we don't store them in netdb
|
||||||
m_RemoteLeaseSets[ident] = ls;
|
m_RemoteLeaseSets[ident] = ls;
|
||||||
|
@ -621,7 +621,7 @@ namespace stream
|
|||||||
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
|
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::tunnel::TUNNEL_EXPIRATION_THRESHOLD*1000)
|
||||||
UpdateCurrentRemoteLease (true);
|
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;
|
std::vector<i2p::tunnel::TunnelMessageBlock> msgs;
|
||||||
for (auto it: packets)
|
for (auto it: packets)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user