X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=consensus%2Fgeneral.go;h=f3bab4e09196125d2138450ba240fe31502d8192;hb=60d1d8f9290cc8269ba2a764fbe48ef940b42614;hp=32620ac1840278e79747662a4c6262438b097785;hpb=3eb2ec67d268c0e1abf3d5346aee60e9c728ab6e;p=bytom%2Fvapor.git diff --git a/consensus/general.go b/consensus/general.go index 32620ac1..f3bab4e0 100644 --- a/consensus/general.go +++ b/consensus/general.go @@ -2,6 +2,7 @@ package consensus import ( "encoding/binary" + "fmt" "github.com/vapor/protocol/bc" ) @@ -225,3 +226,11 @@ func BytomMainNetParams(vaporParam *Params) *Params { } return &Params{Bech32HRPSegwit: bech32HRPSegwit} } + +func InitActiveNetParams(chainID string) error { + var exist bool + if ActiveNetParams, exist = NetParams[chainID]; !exist { + return fmt.Errorf("chain_id[%v] don't exist", chainID) + } + return nil +}