mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
beacon/blsync: simplified blsync cl param checks
This commit is contained in:
parent
03ad1c3e86
commit
b955cc5ff7
1 changed files with 6 additions and 12 deletions
|
|
@ -72,27 +72,21 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func makeChainConfig(ctx *cli.Context) lightClientConfig {
|
func makeChainConfig(ctx *cli.Context) lightClientConfig {
|
||||||
var (
|
var config lightClientConfig
|
||||||
config lightClientConfig
|
|
||||||
predefConfig bool
|
|
||||||
)
|
|
||||||
customConfig := ctx.IsSet(utils.BeaconConfigFlag.Name)
|
customConfig := ctx.IsSet(utils.BeaconConfigFlag.Name)
|
||||||
utils.CheckExclusive(ctx, utils.MainnetFlag, utils.GoerliFlag, utils.SepoliaFlag)
|
utils.CheckExclusive(ctx, utils.MainnetFlag, utils.GoerliFlag, utils.SepoliaFlag, utils.BeaconConfigFlag)
|
||||||
switch {
|
switch {
|
||||||
case ctx.Bool(utils.MainnetFlag.Name):
|
case ctx.Bool(utils.MainnetFlag.Name):
|
||||||
config, predefConfig = MainnetConfig, true
|
config = MainnetConfig
|
||||||
case ctx.Bool(utils.SepoliaFlag.Name):
|
case ctx.Bool(utils.SepoliaFlag.Name):
|
||||||
config, predefConfig = SepoliaConfig, true
|
config = SepoliaConfig
|
||||||
case ctx.Bool(utils.GoerliFlag.Name):
|
case ctx.Bool(utils.GoerliFlag.Name):
|
||||||
config, predefConfig = GoerliConfig, true
|
config = GoerliConfig
|
||||||
default:
|
default:
|
||||||
if !customConfig {
|
if !customConfig {
|
||||||
config, predefConfig = MainnetConfig, true
|
config = MainnetConfig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if customConfig && predefConfig {
|
|
||||||
utils.Fatalf("Cannot use custom beacon chain config flags in combination with pre-defined network config")
|
|
||||||
}
|
|
||||||
// Genesis root and time should always be specified together with custom chain config
|
// Genesis root and time should always be specified together with custom chain config
|
||||||
if customConfig {
|
if customConfig {
|
||||||
if !ctx.IsSet(utils.BeaconGenesisRootFlag.Name) {
|
if !ctx.IsSet(utils.BeaconGenesisRootFlag.Name) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue