diff --git a/core/blockchain.go b/core/blockchain.go index cb4bcc56ce..36187dcf86 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1585,7 +1585,7 @@ func (bc *BlockChain) InsertChain(chain types.Blocks) (int, error) { // Do a sanity check that the provided chain is actually ordered and linked for i := 1; i < len(chain); i++ { block, prev := chain[i], chain[i-1] - if block.NumberU64() != chain[i-1].NumberU64()+1 || block.ParentHash() != chain[i-1].Hash() { + if block.NumberU64() != prev.NumberU64()+1 || block.ParentHash() != prev.Hash() { // Chain broke ancestry, log a messge (programming error) and skip insertion log.Error("Non contiguous block insert", "number", block.Number(),