* 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
pull/1658/head
Jeff Becker 3 years ago
parent 503db46eca
commit 23a82c493f
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -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…
Cancel
Save