Fix wrong state given to op pool prune

This commit is contained in:
Paul Hauner 2019-08-13 07:35:52 +10:00
parent d5d60874e5
commit 24b2f83713
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C

View File

@ -1199,8 +1199,12 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
self.fork_choice
.process_finalization(&finalized_block, finalized_block_root)?;
self.op_pool
.prune_all(&self.head().beacon_state, &self.spec);
let finalized_state = self
.store
.get::<BeaconState<T::EthSpec>>(&finalized_block.state_root)?
.ok_or_else(|| Error::MissingBeaconState(finalized_block.state_root))?;
self.op_pool.prune_all(&finalized_state, &self.spec);
Ok(())
}