Fix bug in per block processing.

This commit is contained in:
Paul Hauner 2019-03-17 12:49:55 +11:00
parent 6bd2055a0a
commit 3b8c1df5da
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -142,12 +142,10 @@ fn validate_attestation_signature_optional(
);
// Get the committee for the specific shard that this attestation is for.
let relative_epoch = RelativeEpoch::from_slot(state.slot, attestation.data.slot, spec)
.map_err(|_| BeaconStateError::EpochOutOfBounds)?; // Should not fail due to previous checks.
let crosslink_committee = state
.get_crosslink_committees_at_slot(
attestation.data.slot,
RelativeEpoch::NextWithoutRegistryChange,
spec,
)?
.get_crosslink_committees_at_slot(attestation.data.slot, relative_epoch, spec)?
.iter()
.find(|c| c.shard == attestation.data.shard)
.ok_or_else(|| {