From 6df133cab25a46051694476ad0487f1ccfa50c69 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 9 Feb 2019 09:15:54 -0500 Subject: [PATCH] remove dead sessions when done --- llarp/service/endpoint.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index e77e217bd..d790aea45 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -344,7 +344,7 @@ namespace llarp auto itr = m_DeadSessions.begin(); while(itr != m_DeadSessions.end()) { - if(itr->second->IsDone(now) && itr->second->ShouldRemove()) + if(itr->second->IsDone(now)) itr = m_DeadSessions.erase(itr); else ++itr; @@ -394,7 +394,7 @@ namespace llarp bool Endpoint::OutboundContext::IsDone(llarp_time_t now) const { - return now - lastGoodSend > DEFAULT_PATH_LIFETIME && ShouldRemove(); + return now - lastGoodSend > (DEFAULT_PATH_LIFETIME / 4) && ShouldRemove(); } uint64_t