From 62bae2075b480a2632bed13a0ba473fccd41316b Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 18 Sep 2018 20:17:35 -0400 Subject: [PATCH] proper shift --- include/llarp/service/endpoint.hpp | 2 ++ llarp/service/endpoint.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/llarp/service/endpoint.hpp b/include/llarp/service/endpoint.hpp index 3118bb25f..f8280319d 100644 --- a/include/llarp/service/endpoint.hpp +++ b/include/llarp/service/endpoint.hpp @@ -194,6 +194,8 @@ namespace llarp ShiftIntroduction(){}; virtual void UpdateIntroSet(){}; + virtual void + MarkCurrentIntroBad(){}; private: void diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index 939c84647..114960484 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -1130,6 +1130,12 @@ namespace llarp auto path = m_PathSet->GetPathByRouter(remoteIntro.router); if(path) { + auto now = llarp_time_now_ms(); + if(remoteIntro.ExpiresSoon(now)) + { + MarkCurrentIntroBad(); + ShiftIntroduction(); + } routing::PathTransferMessage transfer(msg, remoteIntro.pathID); if(!path->SendRoutingMessage(&transfer, m_Endpoint->Router())) llarp::LogError("Failed to send frame on path");