This fixes a race condition in node.node_receive_quorum. Election creation is done after transaction commit so there isn't a guarantee the election will be created as the block is observable in the ledger. (#2971)

This commit is contained in:
clemahieu 2020-09-24 12:22:12 +02:00 committed by GitHub
commit abf9014568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,6 +256,7 @@ TEST (node, node_receive_quorum)
.build_shared ();
node1.process_active (send);
ASSERT_TIMELY (10s, node1.ledger.block_exists (send->hash ()));
ASSERT_TIMELY (10s, node1.active.election (nano::qualified_root (previous, previous)) != nullptr);
auto election (node1.active.election (nano::qualified_root (previous, previous)));
ASSERT_NE (nullptr, election);
ASSERT_FALSE (election->confirmed ());