better introset publish logic

pull/482/head
Jeff 6 years ago
parent 169d8beded
commit 60a42a83a3

@ -726,7 +726,20 @@ namespace llarp
{ {
if(NumInStatus(llarp::path::ePathEstablished) < 3) if(NumInStatus(llarp::path::ePathEstablished) < 3)
return false; 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_RETRY_INTERVAL;
return now - m_LastPublishAttempt >= INTROSET_PUBLISH_INTERVAL; return now - m_LastPublishAttempt >= INTROSET_PUBLISH_INTERVAL;
} }

Loading…
Cancel
Save