aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-16 06:11:40 +0800
committerobscuren <geffobscura@gmail.com>2015-04-16 06:11:40 +0800
commitdff39553d4e731fcfbac21fccf11974e98478176 (patch)
tree09f311ab694abe3711eba402f4b5333beb5507d6 /core
parentec6cbb914b4e3070ad2fd6194c2fa6de2c1080cc (diff)
downloaddexon-dff39553d4e731fcfbac21fccf11974e98478176.tar
dexon-dff39553d4e731fcfbac21fccf11974e98478176.tar.gz
dexon-dff39553d4e731fcfbac21fccf11974e98478176.tar.bz2
dexon-dff39553d4e731fcfbac21fccf11974e98478176.tar.lz
dexon-dff39553d4e731fcfbac21fccf11974e98478176.tar.xz
dexon-dff39553d4e731fcfbac21fccf11974e98478176.tar.zst
dexon-dff39553d4e731fcfbac21fccf11974e98478176.zip
core: changed split detection to also account for number less than
Diffstat (limited to 'core')
-rw-r--r--core/chain_manager.go3
1 files changed, 2 insertions, 1 deletions
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()