Fix: stop ignoring updates to newly initialized mempools (#6448)
This commit is contained in:
parent
3b259b1746
commit
f92db25f72
|
@ -319,14 +319,11 @@ impl Service<Request> for Mempool {
|
||||||
|
|
||||||
let tip_action = self.chain_tip_change.last_tip_change();
|
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.
|
// 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!(
|
info!(
|
||||||
tip_height = ?tip_action.as_ref().unwrap().best_tip_height(),
|
tip_height = ?tip_action.as_ref().unwrap().best_tip_height(),
|
||||||
"resetting mempool: switched best chain, skipped blocks, or activated network upgrade"
|
"resetting mempool: switched best chain, skipped blocks, or activated network upgrade"
|
||||||
|
|
Loading…
Reference in New Issue