OSDN Git Service

fix conflict
authorChengcheng Zhang <943420582@qq.com>
Wed, 29 May 2019 13:23:52 +0000 (21:23 +0800)
committerChengcheng Zhang <943420582@qq.com>
Wed, 29 May 2019 13:23:52 +0000 (21:23 +0800)
1  2 
config/genesis.go
protocol/bbft.go
protocol/bc/types/map.go
test/bench_blockchain_test.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 {
@@@ -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
        }
Simple merge
Simple merge