Fix lazy mutex unlock via mutex (#2382)

This commit is contained in:
cryptocode 2019-11-04 17:04:08 +01:00 committed by GitHub
commit e489cf4b28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -787,13 +787,13 @@ void nano::bootstrap_attempt::lazy_add (nano::hash_or_account const & hash_or_ac
void nano::bootstrap_attempt::lazy_requeue (nano::block_hash const & hash_a, nano::block_hash const & previous_a, bool confirmed_a)
{
nano::lock_guard<std::mutex> lazy_lock (lazy_mutex);
nano::unique_lock<std::mutex> lazy_lock (lazy_mutex);
// Add only known blocks
auto existing (lazy_blocks.find (hash_a));
if (existing != lazy_blocks.end ())
{
lazy_blocks.erase (existing);
lazy_mutex.unlock ();
lazy_lock.unlock ();
requeue_pull (nano::pull_info (hash_a, hash_a, previous_a, static_cast<nano::pull_info::count_t> (1), confirmed_a ? std::numeric_limits<unsigned>::max () : node->network_params.bootstrap.lazy_destinations_retry_limit));
}
}