Remove unused method

This commit is contained in:
Paul Hauner 2019-08-10 17:21:54 +10:00
parent 0d4b58978c
commit 1beab66078
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C

View File

@ -178,27 +178,9 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
Ok(()) Ok(())
} }
/// Determines whether or not the given attestation contains a latest message. /// Returns the latest message for a given validator, if any.
pub fn should_process_attestation( ///
&self, /// Returns `(block_root, block_slot)`.
state: &BeaconState<T::EthSpec>,
attestation: &Attestation<T::EthSpec>,
) -> Result<bool> {
let validator_indices =
get_attesting_indices(state, &attestation.data, &attestation.aggregation_bits)?;
let block_slot = state.get_attestation_data_slot(&attestation.data)?;
Ok(validator_indices
.iter()
.find(|&&v| match self.backend.latest_message(v) {
Some((_, slot)) => block_slot > slot,
None => true,
})
.is_some())
}
// Returns the latest message for a given validator
pub fn latest_message(&self, validator_index: usize) -> Option<(Hash256, Slot)> { pub fn latest_message(&self, validator_index: usize) -> Option<(Hash256, Slot)> {
self.backend.latest_message(validator_index) self.backend.latest_message(validator_index)
} }