Skip to content

Commit

Permalink
make sure to handle initial reconfig event first, similar to consensus
Browse files Browse the repository at this point in the history
  • Loading branch information
bchocho committed Nov 8, 2022
1 parent 243db64 commit d1754ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mempool/src/shared_mempool/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub(crate) async fn coordinator<V>(
LogEntry::CoordinatorRuntime,
LogEvent::Start
));

// Combine `NetworkEvents` for each `NetworkId` into one stream
let smp_events: Vec<_> = network_events
.into_iter()
Expand All @@ -67,6 +68,17 @@ pub(crate) async fn coordinator<V>(
let workers_available = smp.config.shared_mempool_max_concurrent_inbound_syncs;
let bounded_executor = BoundedExecutor::new(workers_available, executor.clone());

let initial_reconfig = mempool_reconfig_events
.next()
.await
.expect("Reconfig sender dropped, unable to start mempool");
handle_mempool_reconfig_event(
&mut smp,
&bounded_executor,
initial_reconfig.on_chain_configs,
)
.await;

loop {
let _timer = counters::MAIN_LOOP.start_timer();
::futures::select! {
Expand Down

0 comments on commit d1754ed

Please sign in to comment.