Update attestation_validator for spec updates

This commit is contained in:
Paul Hauner
2018-12-13 17:33:16 +11:00
parent 96c2012434
commit 493a16ac18
2 changed files with 3 additions and 2 deletions

View File

@@ -12,8 +12,9 @@ use super::{Error, Invalid, Outcome};
pub fn validate_attestation_justified_slot(
data: &AttestationData,
state: &BeaconState,
epoch_length: u64,
) -> Result<Outcome, Error> {
let permissable_justified_slot = if data.slot >= state.latest_state_recalculation_slot {
let permissable_justified_slot = if data.slot >= state.slot - (state.slot % epoch_length) {
state.justified_slot
} else {
state.previous_justified_slot