Merge pull request #16068 from karalabe/import-known-rolledback-blocks

core: force import known but rolled back blocks
pull/16071/head
Péter Szilágyi 7 years ago committed by GitHub
commit 1d39912a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      core/blockchain.go

@ -1070,8 +1070,12 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
} }
switch { switch {
case err == ErrKnownBlock: case err == ErrKnownBlock:
stats.ignored++ // Block and state both already known. However if the current block is below
continue // this number we did a rollback and we should reimport it nonetheless.
if bc.CurrentBlock().NumberU64() >= block.NumberU64() {
stats.ignored++
continue
}
case err == consensus.ErrFutureBlock: case err == consensus.ErrFutureBlock:
// Allow up to MaxFuture second in the future blocks. If this limit is exceeded // Allow up to MaxFuture second in the future blocks. If this limit is exceeded

Loading…
Cancel
Save