From f108af3d8b4c066264f944f5211068bb88488dd8 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 3 May 2021 11:35:40 -0400 Subject: [PATCH] only use alive paths for lookups only track usage from sessions and don't care about intro timeouts --- llarp/service/endpoint_util.hpp | 2 +- llarp/service/session.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llarp/service/endpoint_util.hpp b/llarp/service/endpoint_util.hpp index 7f01a65a6..2aa66bfd4 100644 --- a/llarp/service/endpoint_util.hpp +++ b/llarp/service/endpoint_util.hpp @@ -50,7 +50,7 @@ namespace llarp { --tries; const auto path = ep->PickRandomEstablishedPath(); - if (path) + if (path and path->IsReady()) paths.emplace(path); } while (tries > 0 and paths.size() < N); return paths; diff --git a/llarp/service/session.cpp b/llarp/service/session.cpp index bf710dcdd..0a410b641 100644 --- a/llarp/service/session.cpp +++ b/llarp/service/session.cpp @@ -27,7 +27,7 @@ namespace llarp const auto lastUsed = std::max(lastSend, lastRecv); if (lastUsed == 0s) return intro.IsExpired(now); - return now > lastUsed && (now - lastUsed > lifetime || intro.IsExpired(now)); + return now > lastUsed && now - lastUsed > lifetime; } void