Always erase ending connections from active or connecting pool.

This commit is contained in:
clemahieu 2017-06-20 13:19:38 -05:00
commit 79b2a530c4

View file

@ -874,17 +874,14 @@ void rai::bootstrap_attempt::pool_connection (std::shared_ptr <rai::bootstrap_cl
void rai::bootstrap_attempt::connection_ending (rai::bootstrap_client * client_a)
{
if (state != rai::attempt_state::complete)
std::lock_guard <std::mutex> lock (mutex);
if (!client_a->pull_client.pull.account.is_zero ())
{
std::lock_guard <std::mutex> 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 <rai::bootstrap_client> client_a)