Skip to content

Commit 06aa3e3

Browse files
fix(cmd/cfg): Use Babe Lead value from toml config (#2032)
Earlier, babe lead value was read only from "babe-lead" cli flag. cfg.BABELead was being set to false in case this flag was not provided. This commit sets cfg.BABELead from toml config and uses "babe-lead" cli flag only when it is set.
1 parent 84883c6 commit 06aa3e3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cmd/gossamer/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,11 @@ func setDotCoreConfig(ctx *cli.Context, tomlCfg ctoml.CoreConfig, cfg *dot.CoreC
568568
cfg.BabeAuthority = tomlCfg.Roles == types.AuthorityRole
569569
cfg.GrandpaAuthority = tomlCfg.Roles == types.AuthorityRole
570570
cfg.GrandpaInterval = time.Second * time.Duration(tomlCfg.GrandpaInterval)
571-
cfg.BABELead = ctx.GlobalBool(BABELeadFlag.Name)
571+
572+
cfg.BABELead = tomlCfg.BABELead
573+
if ctx.IsSet(BABELeadFlag.Name) {
574+
cfg.BABELead = ctx.GlobalBool(BABELeadFlag.Name)
575+
}
572576

573577
// check --roles flag and update node configuration
574578
if roles := ctx.GlobalString(RolesFlag.Name); roles != "" {

dot/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ func DevConfig() *Config {
333333
BabeAuthority: dev.DefaultBabeAuthority,
334334
GrandpaAuthority: dev.DefaultGrandpaAuthority,
335335
WasmInterpreter: dev.DefaultWasmInterpreter,
336+
BABELead: dev.DefaultBabeAuthority,
336337
},
337338
Network: NetworkConfig{
338339
Port: dev.DefaultNetworkPort,

0 commit comments

Comments
 (0)