Skip to content

Commit

Permalink
blockchain.go: fix check canonical
Browse files Browse the repository at this point in the history
  • Loading branch information
alanorwick committed Jul 21, 2022
1 parent 276bcbc commit b74e0b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2224,6 +2224,8 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool, setHead
return it.index, err
}
return it.index, nil
} else if err.Error() == "dominant chain is uncled" {
return it.index, nil
} else {
return it.index, err
}
Expand Down Expand Up @@ -3552,6 +3554,7 @@ func (bc *BlockChain) CheckCanonical(header *types.Header, order int) error {
case quaiclient.CanonStatTy:
if (lastUncleHash != common.Hash{}) {
bc.ReOrgRollBack(lastUncleHeader, []*types.Header{}, []*types.Header{})
return errors.New("dominant chain is uncled")
}
return nil
case quaiclient.SideStatTy:
Expand Down

0 comments on commit b74e0b9

Please sign in to comment.