Remove debug_assert which is hit calling block_confirm (#3031)
This commit is contained in:
parent
abba607428
commit
abfe2b05b6
2 changed files with 3 additions and 19 deletions
|
@ -529,19 +529,10 @@ void nano::confirmation_height_bounded::cement_blocks (nano::write_guard & scope
|
|||
// Bail if there was an error. This indicates that there was a fatal issue with the ledger
|
||||
// (the blocks probably got rolled back when they shouldn't have).
|
||||
release_assert (!error);
|
||||
// Tests should check this already at the end, but not all blocks may have elections (e.g from manual calls to confirmation_height_processor::add), this should catch any inconsistencies on live/beta though
|
||||
if (!network_params.network.is_dev_network ())
|
||||
if (!network_params.network.is_dev_network () && time_spent_cementing > maximum_batch_write_time)
|
||||
{
|
||||
auto blocks_confirmed_stats = ledger.stats.count (nano::stat::type::confirmation_height, nano::stat::detail::blocks_confirmed);
|
||||
auto observer_stats = ledger.stats.count (nano::stat::type::confirmation_observer, nano::stat::detail::all, nano::stat::dir::out);
|
||||
debug_assert (blocks_confirmed_stats == observer_stats);
|
||||
|
||||
// Lower batch_write_size if it took too long to write that amount.
|
||||
if (time_spent_cementing > maximum_batch_write_time)
|
||||
{
|
||||
// Reduce (unless we have hit a floor)
|
||||
batch_write_size = std::max<uint64_t> (minimum_batch_write_size, batch_write_size - amount_to_change);
|
||||
}
|
||||
// Reduce (unless we have hit a floor)
|
||||
batch_write_size = std::max<uint64_t> (minimum_batch_write_size, batch_write_size - amount_to_change);
|
||||
}
|
||||
|
||||
debug_assert (pending_writes.empty ());
|
||||
|
|
|
@ -405,13 +405,6 @@ void nano::confirmation_height_unbounded::cement_blocks (nano::write_guard & sco
|
|||
notify_observers_callback (cemented_blocks);
|
||||
release_assert (!error);
|
||||
|
||||
// Tests should check this already at the end, but not all blocks may have elections (e.g from manual calls to confirmation_height_processor::add), this should catch any inconsistencies on live/beta though
|
||||
if (!network_params.network.is_dev_network ())
|
||||
{
|
||||
auto blocks_confirmed_stats = ledger.stats.count (nano::stat::type::confirmation_height, nano::stat::detail::blocks_confirmed);
|
||||
auto observer_stats = ledger.stats.count (nano::stat::type::confirmation_observer, nano::stat::detail::all, nano::stat::dir::out);
|
||||
debug_assert (blocks_confirmed_stats == observer_stats);
|
||||
}
|
||||
debug_assert (pending_writes.empty ());
|
||||
debug_assert (pending_writes_size == 0);
|
||||
timer.restart ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue