diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 32d924837..91129e05b 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -255,7 +255,7 @@ func createGlobalConfig() *nodeconfig.ConfigType { netType := nodeconfig.NetworkType(*networkType) switch netType { case nodeconfig.Mainnet, nodeconfig.Testnet, nodeconfig.Pangaea, nodeconfig.Localnet, nodeconfig.Devnet: - nodeConfig.SetNetworkType(netType) + nodeconfig.SetNetworkType(netType) default: panic(fmt.Sprintf("invalid network type: %s", *networkType)) } diff --git a/internal/configs/node/config.go b/internal/configs/node/config.go index 21f1ab3c1..28aa01b90 100644 --- a/internal/configs/node/config.go +++ b/internal/configs/node/config.go @@ -223,8 +223,10 @@ func (conf *ConfigType) Role() Role { } // SetNetworkType set the networkType -func (conf *ConfigType) SetNetworkType(networkType NetworkType) { - conf.networkType = networkType +func SetNetworkType(networkType NetworkType) { + for i := range shardConfigs { + shardConfigs[i].networkType = networkType + } } // GetNetworkType gets the networkType