Skip to content

Commit

Permalink
Using a timeout counter in line with other test idioms.
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu committed Jan 15, 2020
1 parent 06dfafc commit ab2771a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nano/core_test/active_transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,11 +637,13 @@ TEST (active_transactions, restart_dropped)
}
ASSERT_NO_ERROR (system.poll ());
}
// Verify the block was updated in the ledger
std::shared_ptr<nano::block> block;
while (block == nullptr)
{
auto block (node.store.block_get (node.store.tx_begin_write (), send1->hash ()));
ASSERT_EQ (work2, block->block_work ());
ASSERT_NO_ERROR (system.poll ());
block = node.store.block_get (node.store.tx_begin_read (), send1->hash ());
}
ASSERT_EQ (work2, block->block_work ());
// Drop election
node.active.erase (*send2);
// Try to restart election with the lower difficulty block, should not work since the block as lower work
Expand Down

0 comments on commit ab2771a

Please sign in to comment.