mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
* don't include failed at when we are the pivot router as that case never happens.
* mark paths as ingored instead of expired when we stop a path builder * only remove path builder when we have no established paths
This commit is contained in:
parent
503db46eca
commit
23a82c493f
2 changed files with 3 additions and 9 deletions
|
@ -184,10 +184,6 @@ namespace llarp
|
|||
{
|
||||
failedAt = hops[index + 1].rc.pubkey;
|
||||
}
|
||||
else
|
||||
{
|
||||
failedAt = hops[index].rc.pubkey;
|
||||
}
|
||||
break;
|
||||
}
|
||||
++index;
|
||||
|
|
|
@ -267,14 +267,12 @@ namespace llarp
|
|||
Builder::Stop()
|
||||
{
|
||||
_run = false;
|
||||
// tell all our paths that they have expired
|
||||
// tell all our paths that they are to be ignored
|
||||
const auto now = Now();
|
||||
for (auto& item : m_Paths)
|
||||
{
|
||||
item.second->EnterState(ePathExpired, now);
|
||||
item.second->EnterState(ePathIgnore, now);
|
||||
}
|
||||
// remove expired paths
|
||||
ExpirePaths(now, m_router);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -287,7 +285,7 @@ namespace llarp
|
|||
bool
|
||||
Builder::ShouldRemove() const
|
||||
{
|
||||
return IsStopped();
|
||||
return IsStopped() and NumInStatus(ePathEstablished) == 0;
|
||||
}
|
||||
|
||||
const SecretKey&
|
||||
|
|
Loading…
Reference in a new issue