only publish when we have at least 3 established paths

This commit is contained in:
Jeff 2018-10-06 12:03:54 -04:00
parent e5208b65cc
commit 9a60c08810

View File

@ -572,6 +572,8 @@ namespace llarp
bool bool
Endpoint::ShouldPublishDescriptors(llarp_time_t now) const Endpoint::ShouldPublishDescriptors(llarp_time_t now) const
{ {
if(NumInStatus(llarp::path::eEstablished) < 3)
return false;
if(m_IntroSet.HasExpiredIntros(now)) if(m_IntroSet.HasExpiredIntros(now))
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;