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

swap path on inbound convo if expires soon

This commit is contained in:
Jeff Becker 2019-07-01 17:35:49 -04:00
parent f211ff182a
commit 5874c38b38
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
2 changed files with 10 additions and 4 deletions

View file

@ -1160,10 +1160,16 @@ namespace llarp
continue;
// get path for intro
ForEachPath([&](path::Path_ptr path) {
if(!path->IsReady())
return;
if(path->Endpoint() == replyPath.router)
if(path->intro == replyPath)
{
p = path;
return;
}
if(p && p->ExpiresSoon(now) && path->IsReady()
&& path->intro.router == replyPath.router)
{
p = path;
}
});
if(p)
{

View file

@ -98,6 +98,7 @@ namespace llarp
LogInfo("introset is old, dropping");
return true;
}
auto now = Now();
if(i->IsExpired(now))
{
@ -105,7 +106,6 @@ namespace llarp
return true;
}
currentIntroSet = *i;
if(!ShiftIntroduction())
{
LogWarn("failed to pick new intro during introset update");