Removing unnecessary checks for is_dev_network in confirmation height process and remove the subsequently unused instance of nano::network_params that was instantiated statically.

This commit is contained in:
clemahieu 2021-08-03 10:17:52 +01:00
commit 49d66153fa
No known key found for this signature in database
GPG key ID: 43708520C8DFB938
4 changed files with 2 additions and 5 deletions

View file

@ -128,7 +128,6 @@ void nano::confirmation_height_processor::run (confirmation_height_mode mode_a)
else
{
// Pausing is only utilised in some tests to help prevent it processing added blocks until required.
debug_assert (network_params.network.is_dev_network ());
original_block = nullptr;
condition.wait (lk);
}

View file

@ -91,7 +91,6 @@ private:
nano::write_database_queue & write_database_queue;
/** The maximum amount of blocks to write at once. This is dynamically modified by the bounded processor based on previous write performance **/
uint64_t batch_write_size{ 16384 };
nano::network_params network_params;
confirmation_height_unbounded unbounded_processor;
confirmation_height_bounded bounded_processor;

View file

@ -381,8 +381,8 @@ void nano::confirmation_height_unbounded::cement_blocks (nano::write_guard & sco
if (pending.height > confirmation_height)
{
auto block = ledger.store.block.get (transaction, pending.hash);
debug_assert (network_params.network.is_dev_network () || ledger.pruning || block != nullptr);
debug_assert (network_params.network.is_dev_network () || ledger.pruning || block->sideband ().height == pending.height);
debug_assert (ledger.pruning || block != nullptr);
debug_assert (ledger.pruning || block->sideband ().height == pending.height);
if (!block)
{

View file

@ -95,7 +95,6 @@ private:
void collect_unconfirmed_receive_and_sources_for_account (uint64_t, uint64_t, std::shared_ptr<nano::block> const &, nano::block_hash const &, nano::account const &, nano::read_transaction const &, std::vector<receive_source_pair> &, std::vector<nano::block_hash> &, std::vector<nano::block_hash> &, std::shared_ptr<nano::block> original_block);
void prepare_iterated_blocks_for_cementing (preparation_data &);
nano::network_params network_params;
nano::ledger & ledger;
nano::write_database_queue & write_database_queue;
std::chrono::milliseconds batch_separate_pending_min_time;