From 7c3147ca89137fdba92e24351fd27342ce3eecae Mon Sep 17 00:00:00 2001 From: terencechain Date: Tue, 3 May 2022 18:28:08 -0700 Subject: [PATCH] Fix `isProcessedBlock` order of operation (#10620) --- beacon-chain/sync/initial-sync/round_robin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/sync/initial-sync/round_robin.go b/beacon-chain/sync/initial-sync/round_robin.go index 11e5278e3..eebdf0057 100644 --- a/beacon-chain/sync/initial-sync/round_robin.go +++ b/beacon-chain/sync/initial-sync/round_robin.go @@ -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 // 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 false