Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1643,17 +1643,9 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
// First block is pruned
case errors.Is(err, consensus.ErrPrunedAncestor):
if setHead {
if bc.Config().AnzeonEnabled() {
log.Info("Pruned ancestor on Anzeon during insertChain, discard the obsolete block", "number", block.Number(), "hash", block.Hash())
if bc.futureBlocks.Contains(block.Hash()) {
bc.futureBlocks.Remove(block.Hash())
}
return it.index, nil
} else {
// First block is pruned, insert as sidechain and reorg only if TD grows enough
log.Debug("Pruned ancestor, inserting as sidechain", "number", block.Number(), "hash", block.Hash())
return bc.insertSideChain(block, it)
}
// First block is pruned, insert as sidechain and reorg only if TD grows enough
log.Debug("Pruned ancestor, inserting as sidechain", "number", block.Number(), "hash", block.Hash())
return bc.insertSideChain(block, it)
} else {
// We're post-merge and the parent is pruned, try to recover the parent state
log.Debug("Pruned ancestor", "number", block.Number(), "hash", block.Hash())
Expand Down