OSDN Git Service

add log (#373)
[bytom/vapor.git] / consensus / general.go
index 32620ac..f3bab4e 100644 (file)
@@ -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
+}