From b60adc909d8b1eac23883b030839aaae6e381bb4 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Sun, 1 Mar 2020 14:04:37 -0400 Subject: [PATCH] Make IntroSet publish confirmed less verbose Essentially just rate limit the confirmation message to one message per second. --- llarp/service/endpoint.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index fd2225530..c58e72934 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -583,8 +583,16 @@ namespace llarp void Endpoint::IntroSetPublished() { - m_state->m_LastPublish = Now(); - LogInfo(Name(), " IntroSet publish confirmed"); + const auto now = Now(); + // We usually get 4 confirmations back (one for each DHT location), which + // is noisy: suppress this log message if we already had a confirmation in + // the last second. + if(m_state->m_LastPublish < now - 1s) + LogInfo(Name(), " IntroSet publish confirmed"); + else + LogDebug(Name(), " Additional IntroSet publish confirmed"); + + m_state->m_LastPublish = now; if(m_OnReady) m_OnReady->NotifyAsync(NotifyParams()); m_OnReady = nullptr;