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:
parent
d9cae4a6c6
commit
7f9a60066b
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue