mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-23 04:04:12 +00:00
Operation pool: add prune_all
This commit is contained in:
parent
8a7c51271e
commit
a8224aa4ec
@ -351,6 +351,16 @@ impl OperationPool {
|
||||
.filter(|transfer| transfer.slot > finalized_state.slot)
|
||||
.collect();
|
||||
}
|
||||
|
||||
/// Prune all types of transactions given the latest finalized state.
|
||||
pub fn prune_all(&mut self, finalized_state: &BeaconState, spec: &ChainSpec) {
|
||||
self.prune_attestations(finalized_state, spec);
|
||||
self.prune_deposits(finalized_state);
|
||||
self.prune_proposer_slashings(finalized_state, spec);
|
||||
// FIXME: add attester slashings
|
||||
self.prune_voluntary_exits(finalized_state, spec);
|
||||
self.prune_transfers(finalized_state);
|
||||
}
|
||||
}
|
||||
|
||||
/// Filter up to a maximum number of operations out of a slice.
|
||||
|
Loading…
Reference in New Issue
Block a user