core/snailchain.go: continue to iteration if ErrPrunedAncestor

This commit is contained in:
ywzqwwt 2019-02-15 15:40:07 +08:00
parent 6ab8d3a159
commit 5d16717fd3

View file

@ -1173,7 +1173,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, []
return it.index, events, coalescedLogs, err return it.index, events, coalescedLogs, err
} }
// No validation errors for the first block (or chain prefix skipped) // No validation errors for the first block (or chain prefix skipped)
for ; block != nil && err == nil; block, err = it.next() { for ; block != nil && (err == nil || err == consensus.ErrPrunedAncestor); block, err = it.next() {
// If the chain is terminating, stop processing blocks // If the chain is terminating, stop processing blocks
if atomic.LoadInt32(&bc.procInterrupt) == 1 { if atomic.LoadInt32(&bc.procInterrupt) == 1 {
log.Debug("Premature abort during blocks processing") log.Debug("Premature abort during blocks processing")