expunge outbound contexts that have not gotten inbound traffic for a long while

This commit is contained in:
Jeff Becker 2021-07-02 07:41:58 -04:00
parent 32a94c73e2
commit e7ac0f3902
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 4 additions and 0 deletions

View File

@ -404,6 +404,10 @@ namespace llarp
m_ReadyHooks.clear();
}
if (m_LastInboundTraffic > 0s and lastGoodSend > 0s
and now >= sendTimeout + m_LastInboundTraffic)
return true;
const auto timeout = std::max(lastGoodSend, m_LastInboundTraffic);
if (lastGoodSend > 0s and now >= timeout + (sendTimeout / 2))
{