1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

make sure we have a path to the next introduction we want to use

This commit is contained in:
Thomas Winget 2021-06-15 20:53:40 -04:00 committed by Jeff Becker
parent d9cae4a6c6
commit 7f9a60066b
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05

View file

@ -441,13 +441,18 @@ namespace llarp
return false;
size_t numValidPaths = 0;
ForEachPath([now, &numValidPaths](path::Path_ptr path) {
bool havePathToNextIntro = false;
ForEachPath([now, this, &havePathToNextIntro, &numValidPaths](path::Path_ptr path) {
if (not path->IsReady())
return;
if (not path->intro.ExpiresSoon(now, path::intro_path_spread))
if (not path->intro.ExpiresSoon(now, path::default_lifetime - path::intro_path_spread))
{
numValidPaths++;
if (path->intro.router == m_NextIntro.router)
havePathToNextIntro = true;
}
});
return numValidPaths < numDesiredPaths;
return numValidPaths < numDesiredPaths or not havePathToNextIntro;
}
void