Fix race condition identified by TSAN when computing hash

This commit is contained in:
Colin LeMahieu 2023-11-06 14:03:20 +00:00
commit 906cbbf541
No known key found for this signature in database
GPG key ID: 43708520C8DFB938

View file

@ -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 ()));