TSAN error in confirmation height unbounded (#3106)

This commit is contained in:
Wesley Shillingford 2021-03-01 15:07:52 +00:00 committed by GitHub
commit 8a5dfeefad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,6 +65,7 @@ void nano::confirmation_height_unbounded::process ()
debug_assert (current == original_block->hash ()); debug_assert (current == original_block->hash ());
// This is the original block passed so can use it directly // This is the original block passed so can use it directly
block = original_block; block = original_block;
nano::lock_guard<std::mutex> guard (block_cache_mutex);
block_cache[original_block->hash ()] = original_block; block_cache[original_block->hash ()] = original_block;
} }
else else
@ -206,6 +207,7 @@ void nano::confirmation_height_unbounded::collect_unconfirmed_receive_and_source
{ {
debug_assert (hash == hash_a); debug_assert (hash == hash_a);
block = block_a; block = block_a;
nano::lock_guard<std::mutex> guard (block_cache_mutex);
block_cache[hash] = block_a; block_cache[hash] = block_a;
} }
else else