mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 02:54:01 +01:00
request new leaseset if all leases are about to expire
This commit is contained in:
parent
f087654f25
commit
e6cbc842bf
|
@ -1144,12 +1144,14 @@ namespace stream
|
||||||
if (!m_IsRemoteLeaseChangeInProgress && m_RemoteLeaseSet && m_CurrentRemoteLease && ts >= m_CurrentRemoteLease->endDate - i2p::data::LEASE_ENDDATE_THRESHOLD)
|
if (!m_IsRemoteLeaseChangeInProgress && m_RemoteLeaseSet && m_CurrentRemoteLease && ts >= m_CurrentRemoteLease->endDate - i2p::data::LEASE_ENDDATE_THRESHOLD)
|
||||||
{
|
{
|
||||||
auto leases = m_RemoteLeaseSet->GetNonExpiredLeases (false);
|
auto leases = m_RemoteLeaseSet->GetNonExpiredLeases (false);
|
||||||
if (leases.size () > 1)
|
if (leases.size ())
|
||||||
{
|
{
|
||||||
m_IsRemoteLeaseChangeInProgress = true;
|
m_IsRemoteLeaseChangeInProgress = true;
|
||||||
UpdateCurrentRemoteLease (true);
|
UpdateCurrentRemoteLease (true);
|
||||||
m_NextRemoteLease = m_CurrentRemoteLease;
|
m_NextRemoteLease = m_CurrentRemoteLease;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
UpdateCurrentRemoteLease (true);
|
||||||
}
|
}
|
||||||
if (m_CurrentRemoteLease && ts < m_CurrentRemoteLease->endDate + i2p::data::LEASE_ENDDATE_THRESHOLD)
|
if (m_CurrentRemoteLease && ts < m_CurrentRemoteLease->endDate + i2p::data::LEASE_ENDDATE_THRESHOLD)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue