From 3e87300b8849ec96aa8360fa452c82c834e01e7e Mon Sep 17 00:00:00 2001 From: gop Date: Wed, 30 Oct 2024 18:12:23 -0500 Subject: [PATCH] Do not run the check bad hash and recover, and do not ask for bad block from peer --- core/slice.go | 2 -- quai/handler.go | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/slice.go b/core/slice.go index ddae7b37ab..9f5b0343a6 100644 --- a/core/slice.go +++ b/core/slice.go @@ -153,8 +153,6 @@ func NewSlice(db ethdb.Database, config *Config, txConfig *TxPoolConfig, txLooku sl.WriteGenesisBlock(genesisBlock, chainConfig.Location) } - sl.CheckForBadHashAndRecover() - if nodeCtx == common.ZONE_CTX && sl.ProcessingState() { go sl.asyncPendingHeaderLoop() go sl.asyncWorkShareUpdateLoop() diff --git a/quai/handler.go b/quai/handler.go index 5597387957..686c7db0b0 100644 --- a/quai/handler.go +++ b/quai/handler.go @@ -106,6 +106,12 @@ func (h *handler) missingBlockLoop() { select { case blockRequest := <-h.missingBlockCh: + // If the blockRequest Hash is a bad block hash, node should not ask + // any peer for the hash + if h.core.IsBlockHashABadHash(blockRequest.Hash) { + continue + } + _, exists := h.recentBlockReqCache.Get(blockRequest.Hash) if !exists { // Add the block request to the cache to avoid requesting the same block multiple times