From eb626e5834eaf8a855bfb1b4e10aec3ae19b12ff Mon Sep 17 00:00:00 2001 From: terence tsao Date: Tue, 7 May 2019 15:51:41 -0700 Subject: [PATCH] fixed atts verification (#2527) --- beacon-chain/core/blocks/block_operations.go | 2 +- beacon-chain/rpc/proposer_server.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon-chain/core/blocks/block_operations.go b/beacon-chain/core/blocks/block_operations.go index 652f7fe502..c139bac89e 100644 --- a/beacon-chain/core/blocks/block_operations.go +++ b/beacon-chain/core/blocks/block_operations.go @@ -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, diff --git a/beacon-chain/rpc/proposer_server.go b/beacon-chain/rpc/proposer_server.go index 062c5ecbc9..8528f1d338 100644 --- a/beacon-chain/rpc/proposer_server.go +++ b/beacon-chain/rpc/proposer_server.go @@ -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) } }