From 8a5dfeefad824262d337876d8acfe4b133fe2e12 Mon Sep 17 00:00:00 2001 From: Wesley Shillingford Date: Mon, 1 Mar 2021 15:07:52 +0000 Subject: [PATCH] TSAN error in confirmation height unbounded (#3106) --- nano/node/confirmation_height_unbounded.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nano/node/confirmation_height_unbounded.cpp b/nano/node/confirmation_height_unbounded.cpp index b9cf5d420..ee9d327ac 100644 --- a/nano/node/confirmation_height_unbounded.cpp +++ b/nano/node/confirmation_height_unbounded.cpp @@ -65,6 +65,7 @@ void nano::confirmation_height_unbounded::process () debug_assert (current == original_block->hash ()); // This is the original block passed so can use it directly block = original_block; + nano::lock_guard guard (block_cache_mutex); block_cache[original_block->hash ()] = original_block; } else @@ -206,6 +207,7 @@ void nano::confirmation_height_unbounded::collect_unconfirmed_receive_and_source { debug_assert (hash == hash_a); block = block_a; + nano::lock_guard guard (block_cache_mutex); block_cache[hash] = block_a; } else