Community Patch 1 (from VoxPopuli Team) - removed low_active_elections check as if active elections> 500. Election limiting in handled by the election scheduler rather than by individual call sites. (#3540)

This commit is contained in:
clemahieu 2021-11-03 12:00:52 +00:00 committed by GitHub
commit 608b4c4765
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,10 +244,7 @@ void nano::active_transactions::block_cemented_callback (std::shared_ptr<nano::b
// Next-block activations are only done for blocks with previously active elections // Next-block activations are only done for blocks with previously active elections
bool const was_active{ *election_status_type == nano::election_status_type::active_confirmed_quorum || *election_status_type == nano::election_status_type::active_confirmation_height }; bool const was_active{ *election_status_type == nano::election_status_type::active_confirmed_quorum || *election_status_type == nano::election_status_type::active_confirmation_height };
// Activations are only done if there is not a large amount of active elections, ensuring frontier confirmation takes place if (cemented_bootstrap_count_reached && was_active)
auto const low_active_elections = [this] { return this->size () < nano::active_transactions::max_active_elections_frontier_insertion / 2; };
if (cemented_bootstrap_count_reached && was_active && low_active_elections ())
{ {
// Start or vote for the next unconfirmed block // Start or vote for the next unconfirmed block
scheduler.activate (account, transaction); scheduler.activate (account, transaction);