Getting attestation slot via helper method
This commit is contained in:
parent
5e3fe2467a
commit
edd99fafb6
@ -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::{
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user