diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 1a10efe4..b071ea52 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1583,9 +1583,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { if !ctx.GlobalIsSet(DataDirFlag.Name) { cfg.EvilSignersJournalDir = filepath.Join(node.DefaultDataDir(), "testnet", "geth") } - cfg.OldDIDMigrateHeight = new(big.Int).SetUint64(1) - cfg.DocArraySortHeight = new(big.Int).SetUint64(2080000) - + if !ctx.GlobalIsSet(OldDIDMigrateAddrFlag.Name) { + cfg.OldDIDMigrateHeight = new(big.Int).SetUint64(1) + } + if !ctx.GlobalIsSet(DocArraySortHeightFlag.Name) { + cfg.DocArraySortHeight = new(big.Int).SetUint64(2080000) + } case ctx.GlobalBool(RinkebyFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 24 @@ -1595,8 +1598,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { if !ctx.GlobalIsSet(DataDirFlag.Name) { cfg.EvilSignersJournalDir = filepath.Join(node.DefaultDataDir(), "rinkeby", "geth") } - cfg.OldDIDMigrateHeight = new(big.Int).SetUint64(0) - cfg.DocArraySortHeight = new(big.Int).SetUint64(340000) + if !ctx.GlobalIsSet(OldDIDMigrateAddrFlag.Name) { + cfg.OldDIDMigrateHeight = new(big.Int).SetUint64(0) + } + if !ctx.GlobalIsSet(DocArraySortHeightFlag.Name) { + cfg.DocArraySortHeight = new(big.Int).SetUint64(340000) + } case ctx.GlobalBool(GoerliFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 25 @@ -1606,8 +1613,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { if !ctx.GlobalIsSet(DataDirFlag.Name) { cfg.EvilSignersJournalDir = filepath.Join(node.DefaultDataDir(), "goerli", "geth") } - cfg.OldDIDMigrateHeight = new(big.Int).SetUint64(0) - //cfg.DocArraySortHeight = new(big.Int).SetUint64(0) + if !ctx.GlobalIsSet(OldDIDMigrateAddrFlag.Name) { + cfg.OldDIDMigrateHeight = new(big.Int).SetUint64(0) + } + if !ctx.GlobalIsSet(DocArraySortHeightFlag.Name) { + cfg.DocArraySortHeight = new(big.Int).SetUint64(0) + } case ctx.GlobalBool(DeveloperFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 1337 @@ -1634,8 +1645,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { if !ctx.GlobalIsSet(MinerGasPriceFlag.Name) && !ctx.GlobalIsSet(MinerLegacyGasPriceFlag.Name) { cfg.Miner.GasPrice = big.NewInt(1) } - cfg.OldDIDMigrateHeight = new(big.Int).SetUint64(0) - //cfg.DocArraySortHeight = new(big.Int).SetUint64(0) + if !ctx.GlobalIsSet(OldDIDMigrateAddrFlag.Name) { + cfg.OldDIDMigrateHeight = new(big.Int).SetUint64(0) + } + if !ctx.GlobalIsSet(DocArraySortHeightFlag.Name) { + cfg.DocArraySortHeight = new(big.Int).SetUint64(0) + } } }