try not spamming network with builds

pull/686/head
Jeff Becker 5 years ago
parent dcefcd7879
commit 9c24fc15a8
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -237,11 +237,6 @@ namespace llarp
{ {
RegenAndPublishIntroSet(now); RegenAndPublishIntroSet(now);
} }
else if(NumInStatus(path::ePathEstablished) < 3)
{
if(m_IntroSet.HasExpiredIntros(now))
ManualRebuild(1);
}
// expire snode sessions // expire snode sessions
EndpointUtil::ExpireSNodeSessions(now, m_SNodeSessions); EndpointUtil::ExpireSNodeSessions(now, m_SNodeSessions);
@ -636,7 +631,7 @@ namespace llarp
return false; return false;
// make sure we have all paths that are established // make sure we have all paths that are established
// in our introset // in our introset
bool should = false; size_t numNotInIntroset =0;
ForEachPath([&](const path::Path_ptr& p) { ForEachPath([&](const path::Path_ptr& p) {
if(!p->IsReady()) if(!p->IsReady())
return; return;
@ -645,9 +640,9 @@ namespace llarp
if(i == p->intro) if(i == p->intro)
return; return;
} }
should = true; ++numNotInIntroset;
}); });
if(m_IntroSet.HasExpiredIntros(now) || should) if(m_IntroSet.HasExpiredIntros(now) || numNotInIntroset > 1)
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