set genesis hash properly
This commit is contained in:
parent
dcbf09e781
commit
77fee923cb
2 changed files with 4 additions and 1 deletions
|
@ -148,7 +148,7 @@ func MakeDefaultTestArgs() *Args {
|
||||||
Banner: nil,
|
Banner: nil,
|
||||||
Country: DefaultCountry,
|
Country: DefaultCountry,
|
||||||
|
|
||||||
GenesisHash: GENESIS_HASH,
|
GenesisHash: chaincfg.TestNet3Params.GenesisHash.String(),
|
||||||
ServerVersion: HUB_PROTOCOL_VERSION,
|
ServerVersion: HUB_PROTOCOL_VERSION,
|
||||||
ProtocolMin: PROTOCOL_MIN,
|
ProtocolMin: PROTOCOL_MIN,
|
||||||
ProtocolMax: PROTOCOL_MAX,
|
ProtocolMax: PROTOCOL_MAX,
|
||||||
|
|
|
@ -277,6 +277,7 @@ func MakeHubServer(grp *stop.Group, args *Args) *Server {
|
||||||
myDB.Grp = stop.NewDebug(grp)
|
myDB.Grp = stop.NewDebug(grp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine which chain to use based on db and cli values
|
||||||
dbChain := (*chaincfg.Params)(nil)
|
dbChain := (*chaincfg.Params)(nil)
|
||||||
if myDB != nil && myDB.LastState != nil && myDB.LastState.Genesis != nil {
|
if myDB != nil && myDB.LastState != nil && myDB.LastState.Genesis != nil {
|
||||||
// The chain params can be inferred from DBStateValue.
|
// The chain params can be inferred from DBStateValue.
|
||||||
|
@ -313,6 +314,8 @@ func MakeHubServer(grp *stop.Group, args *Args) *Server {
|
||||||
}
|
}
|
||||||
logrus.Infof("network: %v", chain.Name)
|
logrus.Infof("network: %v", chain.Name)
|
||||||
|
|
||||||
|
args.GenesisHash = chain.GenesisHash.String()
|
||||||
|
|
||||||
s := &Server{
|
s := &Server{
|
||||||
GrpcServer: grpcServer,
|
GrpcServer: grpcServer,
|
||||||
Args: args,
|
Args: args,
|
||||||
|
|
Loading…
Reference in a new issue