OSDN Git Service

fix sign block (#112)
[bytom/vapor.git] / config / genesis.go
index 61ac41f..1a1b7f0 100644 (file)
@@ -14,17 +14,17 @@ import (
 )
 
 func FederationProgrom(c *Config) []byte {
-       pubKeys := chainkd.XPubKeys(c.Federation.Xpubs)
-       fedpegScript, err := vmutil.P2SPMultiSigProgram(pubKeys, c.Federation.Quorum)
+       xpubs := c.Federation.Xpubs
+       fedpegScript, err := vmutil.P2SPMultiSigProgram(chainkd.XPubKeys(xpubs), c.Federation.Quorum)
        if err != nil {
-               log.Panicf("Failed generate federation scirpt  for federation")
+               log.Panicf("Failed generate federation scirpt  for federation: " + err.Error())
        }
 
        scriptHash := crypto.Sha256(fedpegScript)
 
        control, err := vmutil.P2WSHProgram(scriptHash)
        if err != nil {
-               log.Panicf("Fail converts scriptHash to program on GenesisArguments: %v", err)
+               log.Panicf("Fail converts scriptHash to program on FederationProgrom: %v", err)
        }
 
        return control
@@ -44,7 +44,7 @@ func GenesisTx() *types.Tx {
                        types.NewCoinbaseInput(coinbaseInput[:]),
                },
                Outputs: []*types.TxOutput{
-                       types.NewIntraChainOutput(*consensus.BTMAssetID, consensus.InitialBlockSubsidy, contract),
+                       types.NewIntraChainOutput(*consensus.BTMAssetID, consensus.BlockSubsidy(0), contract),
                },
        }
        return types.NewTx(txData)