limit path reanimation

* wait for a limited time for dead paths to reanimate and then remove them after that forever
pull/1614/head
Jeff Becker 3 years ago
parent b31a484bc9
commit f69ccb73a8
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -499,6 +499,9 @@ namespace llarp
}
}
/// how long we wait for a path to become active again after it times out
constexpr auto PathReanimationTimeout = 45s;
bool
Path::Expired(llarp_time_t now) const
{
@ -506,7 +509,11 @@ namespace llarp
return true;
if (_status == ePathBuilding)
return false;
if (_status == ePathEstablished || _status == ePathTimeout)
if (_status == ePathTimeout)
{
return now >= m_LastRecvMessage + PathReanimationTimeout;
}
if (_status == ePathEstablished)
{
return now >= ExpireTime();
}

Loading…
Cancel
Save