Skip to content

Commit

Permalink
Revert "Avoid bootstrap notifications from live traffic (#4463)"
Browse files Browse the repository at this point in the history
This reverts commit ebbc881.
  • Loading branch information
pwojcikdev committed Jul 6, 2024
1 parent 7248c81 commit c314893
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions nano/node/bootstrap_ascending/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,20 @@ nano::bootstrap_ascending::service::service (nano::node_config & config_a, nano:
scoring{ config.bootstrap_ascending, config.network_params.network },
database_limiter{ config.bootstrap_ascending.database_requests_limit, 1.0 }
{
// TODO: This is called from a very congested blockprocessor thread. Offload this work to a dedicated processing thread
block_processor.batch_processed.add ([this] (auto const & batch) {
bool should_notify = false;
{
nano::lock_guard<nano::mutex> lock{ mutex };

auto transaction = ledger.tx_begin_read ();
for (auto const & [result, context] : batch)
{
// Do not try to unnecessarily bootstrap live traffic chains
if (context.source == nano::block_source::bootstrap)
{
release_assert (context.block != nullptr);
inspect (transaction, result, *context.block);
should_notify = true;
}
debug_assert (context.block != nullptr);
inspect (transaction, result, *context.block);
}
}
if (should_notify)
{
condition.notify_all ();
}

condition.notify_all ();
});
}

Expand Down

0 comments on commit c314893

Please sign in to comment.