diff --git a/hmy/downloader/downloader.go b/hmy/downloader/downloader.go index 9e132fd27..01ec242ab 100644 --- a/hmy/downloader/downloader.go +++ b/hmy/downloader/downloader.go @@ -280,16 +280,16 @@ func (e *sigVerifyErr) Error() string { return fmt.Sprintf("[VerifyHeaderSignature] %v", e.err.Error()) } -func verifyAndInsertBlocks(bc blockChain, blockExecution bool, blocks types.Blocks) (int, error) { +func verifyAndInsertBlocks(bc blockChain, blocks types.Blocks) (int, error) { for i, block := range blocks { - if err := verifyAndInsertBlock(bc, block, blockExecution, blocks[i+1:]...); err != nil { + if err := verifyAndInsertBlock(bc, block, blocks[i+1:]...); err != nil { return i, err } } return len(blocks), nil } -func verifyAndInsertBlock(bc blockChain, block *types.Block, blockExecution bool, nextBlocks ...*types.Block) error { +func verifyAndInsertBlock(bc blockChain, block *types.Block, nextBlocks ...*types.Block) error { var ( sigBytes bls.SerializedSignature bitmap []byte diff --git a/hmy/downloader/longrange.go b/hmy/downloader/longrange.go index fc4d4962f..4d4935b8f 100644 --- a/hmy/downloader/longrange.go +++ b/hmy/downloader/longrange.go @@ -210,7 +210,7 @@ func (lsi *lrSyncIter) processBlocks(results []*blockResult, targetBN uint64) { blocks := blockResultsToBlocks(results) for i, block := range blocks { - if err := verifyAndInsertBlock(lsi.bc, block, true); err != nil { + if err := verifyAndInsertBlock(lsi.bc, block); err != nil { lsi.logger.Warn().Err(err).Uint64("target block", targetBN). Uint64("block number", block.NumberU64()). Msg("insert blocks failed in long range") diff --git a/hmy/downloader/shortrange.go b/hmy/downloader/shortrange.go index 81adc8131..8276911d4 100644 --- a/hmy/downloader/shortrange.go +++ b/hmy/downloader/shortrange.go @@ -74,7 +74,7 @@ func (d *Downloader) doShortRangeSync() (int, error) { } d.logger.Info().Int("num blocks", len(blocks)).Msg("getBlockByHashes result") - n, err := verifyAndInsertBlocks(d.bc, true, blocks) + n, err := verifyAndInsertBlocks(d.bc, blocks) numBlocksInsertedShortRangeHistogramVec.With(d.promLabels()).Observe(float64(n)) if err != nil { d.logger.Warn().Err(err).Int("blocks inserted", n).Msg("Insert block failed")