From dff39553d4e731fcfbac21fccf11974e98478176 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 16 Apr 2015 00:11:40 +0200 Subject: [PATCH] core: changed split detection to also account for number less than --- core/chain_manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/chain_manager.go b/core/chain_manager.go index ade922217..7e792864a 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -498,7 +498,8 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { // Compare the TD of the last known block in the canonical chain to make sure it's greater. // At this point it's possible that a different chain (fork) becomes the new canonical chain. if td.Cmp(self.td) > 0 { - if block.Header().Number.Cmp(new(big.Int).Add(cblock.Header().Number, common.Big1)) < 0 { + //if block.Header().Number.Cmp(new(big.Int).Add(cblock.Header().Number, common.Big1)) < 0 { + if block.Number().Cmp(cblock.Number()) <= 0 { chash := cblock.Hash() hash := block.Hash() -- GitLab