use upgrade schedule from node when getting the network name
It doesn't matter now, but may in the future.
This commit is contained in:
parent
30bda0b4c4
commit
0c2ec04c09
@ -168,14 +168,19 @@ func SetGenesis(cs *store.ChainStore, g Genesis) (dtypes.AfterGenesisSet, error)
|
||||
return dtypes.AfterGenesisSet{}, cs.SetGenesis(genesis)
|
||||
}
|
||||
|
||||
func NetworkName(mctx helpers.MetricsCtx, lc fx.Lifecycle, cs *store.ChainStore, _ dtypes.AfterGenesisSet) (dtypes.NetworkName, error) {
|
||||
func NetworkName(mctx helpers.MetricsCtx, lc fx.Lifecycle, cs *store.ChainStore, us stmgr.UpgradeSchedule, _ dtypes.AfterGenesisSet) (dtypes.NetworkName, error) {
|
||||
if !build.Devnet {
|
||||
return "testnetnet", nil
|
||||
}
|
||||
|
||||
ctx := helpers.LifecycleCtx(mctx, lc)
|
||||
|
||||
netName, err := stmgr.GetNetworkName(ctx, stmgr.NewStateManager(cs), cs.GetHeaviestTipSet().ParentState())
|
||||
sm, err := stmgr.NewStateManagerWithUpgradeSchedule(cs, us)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
netName, err := stmgr.GetNetworkName(ctx, sm, cs.GetHeaviestTipSet().ParentState())
|
||||
return netName, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user