From: Chengcheng Zhang <943420582@qq.com> Date: Wed, 29 May 2019 13:23:52 +0000 (+0800) Subject: fix conflict X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4752c8c8f59e21b48d1e3035c0cef0e50325ecd4;p=bytom%2Fvapor.git fix conflict --- 4752c8c8f59e21b48d1e3035c0cef0e50325ecd4 diff --cc config/genesis.go index 5f7b22d7,e27e7332..d1cfeb00 --- a/config/genesis.go +++ b/config/genesis.go @@@ -14,18 -13,14 +14,18 @@@ import "github.com/vapor/protocol/vm/vmutil" ) -func FederationProgrom(c *Config) []byte { - pubKeys := chainkd.XPubKeys(c.Federation.Xpubs) - fedpegScript, err := vmutil.P2SPMultiSigProgram(pubKeys, c.Federation.Quorum) +func GenesisArguments(c *Config) []byte { + pubKeys := edchainkd.XPubKeys(c.Federation.Xpubs) + cryptoPub := make([]crypto.PublicKey, 0) + for _, pub := range pubKeys { + cryptoPub = append(cryptoPub, pub) + } + fedpegScript, err := vmutil.P2SPMultiSigProgram(cryptoPub, c.Federation.Quorum) if err != nil { - log.Panicf("fail on decode genesis arguments for federation") + log.Panicf("Failed generate federation scirpt for federation") } - scriptHash := crypto.Sha256(fedpegScript) + scriptHash := vcrypto.Sha256(fedpegScript) control, err := vmutil.P2WSHProgram(scriptHash) if err != nil { diff --cc protocol/bbft.go index b062f587,3a59e47f..44b10098 --- a/protocol/bbft.go +++ b/protocol/bbft.go @@@ -9,10 -8,9 +8,9 @@@ import log "github.com/sirupsen/logrus" "github.com/vapor/crypto/ed25519" - "github.com/vapor/crypto/ed25519/chainkd" + edchainkd "github.com/vapor/crypto/ed25519/chainkd" "github.com/vapor/errors" "github.com/vapor/event" - "github.com/vapor/math/checked" "github.com/vapor/protocol/bc" "github.com/vapor/protocol/bc/types" "github.com/vapor/protocol/state" @@@ -310,9 -212,10 +212,10 @@@ func (b *bbft) checkDoubleSign(nodeOrde // SignBlock signing the block if current node is consensus node func (b *bbft) SignBlock(block *types.Block) ([]byte, error) { - var xprv chainkd.XPrv + var xprv edchainkd.XPrv xpub := [64]byte(xprv.XPub()) - node, err := b.consensusNodeManager.getConsensusNode(block.Height, hex.EncodeToString(xpub[:])) + blockHash := block.Hash() + node, err := b.consensusNodeManager.getConsensusNode(&blockHash, hex.EncodeToString(xpub[:])) if err != nil && err != errNotFoundConsensusNode { return nil, err }