Skip to content

Commit dff3955

Browse files
committed
core: changed split detection to also account for number less than
1 parent ec6cbb9 commit dff3955

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎core/chain_manager.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
498498
// Compare the TD of the last known block in the canonical chain to make sure it's greater.
499499
// At this point it's possible that a different chain (fork) becomes the new canonical chain.
500500
if td.Cmp(self.td) > 0 {
501-
if block.Header().Number.Cmp(new(big.Int).Add(cblock.Header().Number, common.Big1)) < 0 {
501+
//if block.Header().Number.Cmp(new(big.Int).Add(cblock.Header().Number, common.Big1)) < 0 {
502+
if block.Number().Cmp(cblock.Number()) <= 0 {
502503
chash := cblock.Hash()
503504
hash := block.Hash()
504505

0 commit comments

Comments
 (0)