Merge pull request #1881 from majestrate/mark-dead-obctx-2022-03-31

reduce excess path builds
pull/1891/head
majestrate 2 years ago committed by GitHub
commit b6a087187c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -472,6 +472,11 @@ namespace llarp
EnterState(ePathTimeout, now);
}
}
if (_status == ePathIgnore and now - m_LastRecvMessage >= path::alive_timeout)
{
// clean up this path as we dont use it anymore
EnterState(ePathExpired, now);
}
}
void

@ -479,7 +479,8 @@ namespace llarp
{
if (markedBad or path::Builder::BuildCooldownHit(now))
return false;
if (NumInStatus(path::ePathBuilding) >= numDesiredPaths)
if (NumInStatus(path::ePathBuilding) >= std::max(numDesiredPaths / size_t{2}, size_t{1}))
return false;
size_t numValidPaths = 0;

Loading…
Cancel
Save