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:
parent
f211ff182a
commit
5874c38b38
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue