From 60a42a83a32c2b2214e61b36d9fd2155eaea9ce3 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 1 Apr 2019 15:56:11 -0400 Subject: [PATCH] better introset publish logic --- llarp/service/endpoint.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index 185c03317..368d4d7a7 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -726,7 +726,20 @@ namespace llarp { if(NumInStatus(llarp::path::ePathEstablished) < 3) return false; - if(m_IntroSet.HasExpiredIntros(now)) + // make sure we have all paths that are established + // in our introset + bool should = false; + ForEachPath([&](const path::Path *p) { + if(!p->IsReady()) + return; + for(const auto & i : m_IntroSet.I) + { + if(i == p->intro) + return; + } + should = true; + }); + if(m_IntroSet.HasExpiredIntros(now) || should) return now - m_LastPublishAttempt >= INTROSET_PUBLISH_RETRY_INTERVAL; return now - m_LastPublishAttempt >= INTROSET_PUBLISH_INTERVAL; }