Getting attestation slot via helper method

This commit is contained in:
Grant Wuerker 2019-07-25 15:08:18 +02:00
parent 5e3fe2467a
commit edd99fafb6
No known key found for this signature in database
GPG Key ID: F7EA56FDDA6C464F
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ use operation_pool::{OperationPool, PersistedOperationPool};
use parking_lot::{RwLock, RwLockReadGuard};
use slot_clock::SlotClock;
use state_processing::per_block_processing::errors::{
AttestationValidationError, AttesterSlashingValidationError, DepositValidationError,
AttesterSlashingValidationError, DepositValidationError,
ExitValidationError, ProposerSlashingValidationError, TransferValidationError,
};
use state_processing::{

View File

@ -174,13 +174,13 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
&attestation.aggregation_bitfield,
)?;
let target_slot = attestation.data.target_epoch.start_slot(T::EthSpec::slots_per_epoch());
let block_slot = state.get_attestation_slot(&attestation.data)?;
Ok(validator_indices
.iter()
.find(|&&v| {
match self.backend.latest_message(v) {
Some((_, slot)) => target_slot > slot,
Some((_, slot)) => block_slot > slot,
None => true
}
}).is_some())