Skip to content

Commit

Permalink
Fix: stop ignoring updates to newly initialized mempools
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Apr 2, 2023
1 parent 5db2243 commit a2bbf09
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions zebrad/src/components/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,11 @@ impl Service<Request> for Mempool {

let tip_action = self.chain_tip_change.last_tip_change();

// If the mempool was just freshly enabled,
// skip resetting and removing mined transactions for this tip.
if is_state_changed {
return Poll::Ready(Ok(()));
}

// Clear the mempool and cancel downloads if there has been a chain tip reset.
if matches!(tip_action, Some(TipAction::Reset { .. })) {
//
// But if the mempool was just freshly enabled,
// skip resetting and removing mined transactions for this tip.
if !is_state_changed && matches!(tip_action, Some(TipAction::Reset { .. })) {
info!(
tip_height = ?tip_action.as_ref().unwrap().best_tip_height(),
"resetting mempool: switched best chain, skipped blocks, or activated network upgrade"
Expand Down

0 comments on commit a2bbf09

Please sign in to comment.