X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=protocol%2Fbbft.go;fp=protocol%2Fbbft.go;h=d026e959468ed9b20d0aba387cc7eb6c4ca7b90b;hb=f306f89398f21293cb9c70eb5a4967fe55161125;hp=107334af38ad2e7683697cbb08c6b950895c5081;hpb=59473f6c0eb271466cbf454b0605c9b1168725e5;p=bytom%2Fvapor.git diff --git a/protocol/bbft.go b/protocol/bbft.go index 107334af..d026e959 100644 --- a/protocol/bbft.go +++ b/protocol/bbft.go @@ -223,6 +223,14 @@ func (b *bbft) SignBlock(block *types.Block) ([]byte, error) { return nil, nil } + blockNodes := b.consensusNodeManager.blockIndex.NodesByHeight(block.Height) + for _, blockNode := range blockNodes { + // Has already signed the same height block + if ok, err := blockNode.BlockWitness.Test(uint32(node.order)); err != nil && ok { + return nil, nil + } + } + signature := block.Witness[node.order] if len(signature) == 0 { signature = xprv.Sign(block.Hash().Bytes())