proper shift

This commit is contained in:
Jeff Becker 2018-09-18 20:17:35 -04:00
parent f110f3f3ad
commit 62bae2075b
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
2 changed files with 8 additions and 0 deletions

View File

@ -194,6 +194,8 @@ namespace llarp
ShiftIntroduction(){}; ShiftIntroduction(){};
virtual void virtual void
UpdateIntroSet(){}; UpdateIntroSet(){};
virtual void
MarkCurrentIntroBad(){};
private: private:
void void

View File

@ -1130,6 +1130,12 @@ namespace llarp
auto path = m_PathSet->GetPathByRouter(remoteIntro.router); auto path = m_PathSet->GetPathByRouter(remoteIntro.router);
if(path) if(path)
{ {
auto now = llarp_time_now_ms();
if(remoteIntro.ExpiresSoon(now))
{
MarkCurrentIntroBad();
ShiftIntroduction();
}
routing::PathTransferMessage transfer(msg, remoteIntro.pathID); routing::PathTransferMessage transfer(msg, remoteIntro.pathID);
if(!path->SendRoutingMessage(&transfer, m_Endpoint->Router())) if(!path->SendRoutingMessage(&transfer, m_Endpoint->Router()))
llarp::LogError("Failed to send frame on path"); llarp::LogError("Failed to send frame on path");