only use alive paths for lookups

only track usage from sessions and don't care about intro timeouts
pull/1624/head
Jeff Becker 3 years ago
parent 0005bee196
commit f108af3d8b
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -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;

@ -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

Loading…
Cancel
Save