fixed atts verification (#2527)

This commit is contained in:
terence tsao 2019-05-07 15:51:41 -07:00 committed by GitHub
parent 0f0510096e
commit eb626e5834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -442,7 +442,7 @@ func VerifyAttestation(beaconState *pb.BeaconState, att *pb.Attestation, verifyS
beaconState.Slot-params.BeaconConfig().GenesisSlot,
)
}
if att.Data.Slot+params.BeaconConfig().SlotsPerEpoch <= beaconState.Slot {
if att.Data.Slot+params.BeaconConfig().SlotsPerEpoch < beaconState.Slot {
return fmt.Errorf(
"attestation slot (slot %d) + epoch length (%d) less than current beacon state slot (%d)",
att.Data.Slot-params.BeaconConfig().GenesisSlot,

View File

@ -119,9 +119,9 @@ func (ps *ProposerServer) PendingAttestations(ctx context.Context, req *pb.Pendi
beaconState.Slot++
var attsReadyForInclusion []*pbp2p.Attestation
for _, val := range atts {
if val.Data.Slot+params.BeaconConfig().MinAttestationInclusionDelay <= beaconState.Slot {
attsReadyForInclusion = append(attsReadyForInclusion, val)
for _, att := range atts {
if att.Data.Slot+params.BeaconConfig().MinAttestationInclusionDelay <= beaconState.Slot {
attsReadyForInclusion = append(attsReadyForInclusion, att)
}
}