From 906cbbf54169ecc2265f7722c106510fa62f2604 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Mon, 6 Nov 2023 14:03:20 +0000 Subject: [PATCH] Fix race condition identified by TSAN when computing hash --- nano/core_test/node.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index 0213b57880..65ba12a705 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -2143,6 +2143,8 @@ TEST (node, block_confirm) auto send1_copy = builder.make_block () .from (*send1) .build_shared (); + auto hash1 = send1->hash (); + auto hash2 = send1_copy->hash (); node1.block_processor.add (send1); node2.block_processor.add (send1_copy); ASSERT_TIMELY (5s, node1.ledger.block_or_pruned_exists (send1->hash ()) && node2.ledger.block_or_pruned_exists (send1_copy->hash ()));