From 92857507e6d55f2e013ae0311c20059ef6b3d633 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Tue, 8 Aug 2017 20:31:20 -0500 Subject: [PATCH] Moving pulling counting to a more reliable location. --- rai/node/bootstrap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rai/node/bootstrap.cpp b/rai/node/bootstrap.cpp index 182e433f..6431fdde 100755 --- a/rai/node/bootstrap.cpp +++ b/rai/node/bootstrap.cpp @@ -440,10 +440,12 @@ void rai::frontier_req_client::next (MDB_txn * transaction_a) rai::bulk_pull_client::bulk_pull_client (std::shared_ptr connection_a) : connection (connection_a) { + ++connection->attempt->pulling; } rai::bulk_pull_client::~bulk_pull_client () { + --connection->attempt->pulling; } void rai::bulk_pull_client::request (rai::pull_info const & pull_a) @@ -551,7 +553,6 @@ void rai::bulk_pull_client::received_type () if (expected == pull.end) { pull = rai::pull_info (); - --connection->attempt->pulling; connection->work (); } else @@ -892,9 +893,8 @@ void rai::bootstrap_client::work () // There are more things to pull auto pull (attempt->pulls.front ()); attempt->pulls.pop_front (); - ++attempt->pulling; - lock.unlock (); auto pull_client (std::make_shared (shared_from_this ())); + lock.unlock (); pull_client->request (pull); } else