Skip to content

Commit

Permalink
core: force import known but rolled back blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Feb 12, 2018
1 parent 52ad848 commit 69c1f2c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,12 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
}
switch {
case err == ErrKnownBlock:
stats.ignored++
continue
// Block and state both already known. However if the current block is below
// 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:
// Allow up to MaxFuture second in the future blocks. If this limit is exceeded
Expand Down

0 comments on commit 69c1f2c

Please sign in to comment.