Fix isProcessedBlock order of operation (#10620)

This commit is contained in:
terencechain 2022-05-03 18:28:08 -07:00 committed by GitHub
parent 03ae8672b6
commit 7c3147ca89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,7 +311,7 @@ func (s *Service) isProcessedBlock(ctx context.Context, blk interfaces.SignedBea
} }
// If block exists in our db and is before or equal to our current head // If block exists in our db and is before or equal to our current head
// we ignore it. // we ignore it.
if s.cfg.Chain.HasBlock(ctx, blkRoot) && s.cfg.Chain.HeadSlot() >= blk.Block().Slot() { if s.cfg.Chain.HeadSlot() >= blk.Block().Slot() && s.cfg.Chain.HasBlock(ctx, blkRoot) {
return true return true
} }
return false return false