Skip to content

Commit

Permalink
Do not run the check bad hash and recover, and do not ask for bad blo…
Browse files Browse the repository at this point in the history
…ck from peer
  • Loading branch information
gameofpointers committed Oct 30, 2024
1 parent 024fcff commit 3e87300
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions core/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions quai/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e87300

Please sign in to comment.