From 79b2a530c4b0825b04b0f77dec9b50b859ee8cb2 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Tue, 20 Jun 2017 13:19:38 -0500 Subject: [PATCH] Always erase ending connections from active or connecting pool. --- rai/node/bootstrap.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/rai/node/bootstrap.cpp b/rai/node/bootstrap.cpp index 5b8c0176..ecafaece 100755 --- a/rai/node/bootstrap.cpp +++ b/rai/node/bootstrap.cpp @@ -874,17 +874,14 @@ void rai::bootstrap_attempt::pool_connection (std::shared_ptr lock (mutex); + if (!client_a->pull_client.pull.account.is_zero ()) { - std::lock_guard lock (mutex); - if (!client_a->pull_client.pull.account.is_zero ()) - { - // If this connection is ending and request_account hasn't been cleared it didn't finish, requeue - requeue_pull (client_a->pull_client.pull); - } - auto erased_connecting (connecting.erase (client_a)); - auto erased_active (active.erase (client_a)); + // If this connection is ending and request_account hasn't been cleared it didn't finish, requeue + requeue_pull (client_a->pull_client.pull); } + auto erased_connecting (connecting.erase (client_a)); + auto erased_active (active.erase (client_a)); } void rai::bootstrap_attempt::completed_requests (std::shared_ptr client_a)