core, eth/downloader: handle spurious junk bodies from racey rollbacks (#25578)

* eth/downloader: handle junkbodies/receipts in the beacon sync

* core: check for header presence when checking for blocks
This commit is contained in:
Péter Szilágyi
2022-08-23 14:02:51 +03:00
committed by GitHub
parent 6d711f0c00
commit 81bd998353
2 changed files with 10 additions and 6 deletions
+3
View File
@@ -137,6 +137,9 @@ func (bc *BlockChain) HasBlock(hash common.Hash, number uint64) bool {
if bc.blockCache.Contains(hash) {
return true
}
if !bc.HasHeader(hash, number) {
return false
}
return rawdb.HasBody(bc.db, hash, number)
}