From 5861f4aafae18cdbf956fa7db411f9e794553b2a Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 12 Apr 2019 08:05:43 -0400 Subject: [PATCH] * less vigorous profiling * don't spam connections to bootstrap --- llarp/profiling.cpp | 2 +- llarp/router/router.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/llarp/profiling.cpp b/llarp/profiling.cpp index f76964d5b..3734fcaab 100644 --- a/llarp/profiling.cpp +++ b/llarp/profiling.cpp @@ -73,7 +73,6 @@ namespace llarp if(connectTimeoutCount > chances) return connectTimeoutCount < connectGoodCount && (pathSuccessCount * chances) > pathFailCount; - chances /= 2; return (pathSuccessCount * chances) > pathFailCount; } @@ -212,6 +211,7 @@ namespace llarp llarp::LogWarn("failed to load router profiles from ", fname); return false; } + m_LastSave = llarp::time_now_ms(); return true; } diff --git a/llarp/router/router.cpp b/llarp/router/router.cpp index 46872f166..4e43b6c68 100644 --- a/llarp/router/router.cpp +++ b/llarp/router/router.cpp @@ -838,7 +838,7 @@ namespace llarp { if(StrEq(key, "type") && StrEq(val, "syslog")) { - // TODO(despair): write event log syslog class + // TODO(despair): write event log syslog class #if defined(_WIN32) LogError("syslog not supported on win32"); #else @@ -1146,6 +1146,8 @@ namespace llarp { for(const auto &rc : bootstrapRCList) { + if(HasPendingConnectJob(rc.pubkey)) + continue; TryConnectAsync(rc, 4); dht()->impl->ExploreNetworkVia(dht::Key_t{rc.pubkey}); }