Remove old code fragment

This commit is contained in:
Paul Hauner 2019-08-07 16:54:35 +10:00
parent 378fe05c89
commit 65ce94b2ef
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C

View File

@ -648,48 +648,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.map_err(|e| Error::AttestationValidationError(e))
}
/*
/// Retrieves the `BeaconState` used to create the attestation.
fn get_attestation_state(
&self,
attestation: &Attestation<T::EthSpec>,
) -> Option<BeaconState<T::EthSpec>> {
let state = &self.head().beacon_state;
// Current state is used if the attestation targets a historic block and a slot within an
// equal or adjacent epoch.
let slots_per_epoch = T::EthSpec::slots_per_epoch();
let min_slot =
(self.state.read().slot.epoch(slots_per_epoch) - 1).start_slot(slots_per_epoch);
let blocks = BestBlockRootsIterator::owned(
self.store.clone(),
self.state.read().clone(),
self.state.read().slot.clone(),
);
for (root, slot) in blocks {
if root == attestation.data.target.root {
return Some(self.state.read().clone());
}
if slot == min_slot {
break;
}
}
// A different state is retrieved from the database.
match self
.store
.get::<BeaconBlock<T::EthSpec>>(&attestation.data.target.root)
{
Ok(Some(block)) => match self.store.get::<BeaconState<T::EthSpec>>(&block.state_root) {
Ok(state) => state,
_ => None,
},
_ => None,
}
}
*/
/// Accept some deposit and queue it for inclusion in an appropriate block.
pub fn process_deposit(
&self,