Server endpoints goroutine refactor #69

Merged
jeffreypicard merged 18 commits from server-endpoints-goroutine-refactor into master 2022-10-25 07:48:13 +02:00
2 changed files with 4 additions and 1 deletions
Showing only changes of commit 77fee923cb - Show all commits

View file

@ -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,

View file

@ -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,