提交 dff39553 编写于 作者: O obscuren

core: changed split detection to also account for number less than

上级 ec6cbb91
...@@ -498,7 +498,8 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { ...@@ -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. // 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. // At this point it's possible that a different chain (fork) becomes the new canonical chain.
if td.Cmp(self.td) > 0 { 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() chash := cblock.Hash()
hash := block.Hash() hash := block.Hash()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册