• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版9b74aecc0f6e3995423d72069ac203f2406c59a1 (tree)
时间2020-03-16 19:56:05
作者paladz <453256728@qq.c...>
Commiterpaladz

Log Message

no tricks

更改概述

差异

--- a/protocol/bbft.go
+++ b/protocol/bbft.go
@@ -142,8 +142,13 @@ func (c *Chain) validateSign(block *types.Block) error {
142142
143143 if err := c.checkNodeSign(&block.BlockHeader, node, block.Get(node.Order)); err == errDoubleSignBlock {
144144 log.WithFields(log.Fields{"module": logModule, "blockHash": blockHash.String(), "pubKey": pubKey}).Warn("the consensus node double sign the same height of different block")
145- block.BlockWitness.Delete(node.Order)
146- continue
145+ // if the blocker double sign & become the mainchain, that means
146+ // all the side chain will reject the main chain make the chain
147+ // fork. All the node will ban each other & can't roll back
148+ if blocker != pubKey {
149+ block.BlockWitness.Delete(node.Order)
150+ continue
151+ }
147152 } else if err != nil {
148153 return err
149154 }
Show on old repository browser