From c5c28a528f48b2a52ab4725cde233d3dee420961 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 23 Apr 2019 14:29:42 -0400 Subject: [PATCH] exit node tweaks --- llarp/exit/session.cpp | 3 ++- llarp/router/router.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/llarp/exit/session.cpp b/llarp/exit/session.cpp index 5c2adee54..2aaf1e371 100644 --- a/llarp/exit/session.cpp +++ b/llarp/exit/session.cpp @@ -27,6 +27,7 @@ namespace llarp void BaseSession::HandlePathDied(path::Path_ptr) { + BuildOne(); } util::StatusObject @@ -52,7 +53,7 @@ namespace llarp return false; const size_t expect = (1 + (m_NumPaths / 2)); // check 30 seconds into the future and see if we need more paths - const llarp_time_t future = now + (30 * 1000); + const llarp_time_t future = now + (30 * 1000) + buildIntervalLimit; return NumPathsExistingAt(future) < expect; } diff --git a/llarp/router/router.cpp b/llarp/router/router.cpp index 198e9fa40..ab3ea7412 100644 --- a/llarp/router/router.cpp +++ b/llarp/router/router.cpp @@ -1094,6 +1094,8 @@ namespace llarp void Router::Tick() { + if(_stopping) + return; // LogDebug("tick router"); auto now = Now(); @@ -1724,8 +1726,10 @@ namespace llarp || self->HasPendingConnectJob(other.pubkey))) { if(!self->IsBootstrapNode(other.pubkey)) - self->TryConnectAsync(other, 5); - --want; + { + if(self->TryConnectAsync(other, 5)) + --want; + } } return want > 0; });