Skip to content

Commit

Permalink
Fix TSAN issue... maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
dsiganos committed Apr 18, 2024
1 parent 5f5b268 commit 6abdd28
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions nano/core_test/active_transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,20 +1035,27 @@ TEST (active_transactions, confirm_new)
{
nano::test::system system (1);
auto & node1 = *system.nodes[0];
auto send = nano::send_block_builder ()
.previous (nano::dev::genesis->hash ())
.destination (nano::public_key ())
.balance (nano::dev::constants.genesis_amount - 100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build ();
node1.process_active (send);
auto send1 = nano::send_block_builder ()
.previous (nano::dev::genesis->hash ())
.destination (nano::public_key ())
.balance (nano::dev::constants.genesis_amount - 100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build ();
auto send2 = nano::send_block_builder ()
.previous (nano::dev::genesis->hash ())
.destination (nano::public_key ())
.balance (nano::dev::constants.genesis_amount - 100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build ();
node1.process_active (send1);
ASSERT_TIMELY_EQ (5s, 1, node1.active.size ());
auto & node2 = *system.add_node ();
// Add key to node2
system.wallet (1)->insert_adhoc (nano::dev::genesis_key.prv);
// Let node2 know about the block
ASSERT_TIMELY (5s, node2.block (send->hash ()));
ASSERT_TIMELY (5s, node2.block (send2->hash ()));
// Wait confirmation
ASSERT_TIMELY (5s, node1.ledger.cemented_count () == 2);
ASSERT_TIMELY (5s, node2.ledger.cemented_count () == 2);
Expand Down

0 comments on commit 6abdd28

Please sign in to comment.