Skip to content

Commit

Permalink
perf: clear expired deposit in time
Browse files Browse the repository at this point in the history
  • Loading branch information
keroro520 authored and jjyr committed May 26, 2022
1 parent 36abcea commit f86d655
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions crates/mem-pool/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,11 @@ impl MemPool {
}
}

if force_expired {
log::debug!("[mem-pool] forced clear pending deposits");
self.pending_deposits.clear();
}

// refresh
let snap = self.mem_pool_state.load();
let state = snap.state()?;
Expand Down Expand Up @@ -860,13 +865,6 @@ impl MemPool {
"[mem-pool] refreshed deposits: {}",
self.pending_deposits.len()
);
} else if force_expired {
log::debug!(
"[mem-pool] forced clear pending deposits, mem_account_count: {}, tip_account_count: {}",
mem_account_count,
tip_account_count
);
self.pending_deposits.clear();
} else {
log::debug!(
"[mem-pool] skip pending deposits, pending deposits: {}, mem_account_count: {}, tip_account_count: {}",
Expand Down

0 comments on commit f86d655

Please sign in to comment.