Skip to content

Commit

Permalink
params: fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
buddh0 committed Dec 13, 2023
1 parent 8ce9cda commit 1ebf2a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func LoadChainConfig(db ethdb.Database, genesis *Genesis) (*params.ChainConfig,
// set the field in genesis config to the field in defaultConfig.
// Reflection is used to avoid a long series of if statements with hardcoded block names.
func (g *Genesis) setDefaultHardforkValues(defaultConfig *params.ChainConfig) {
// Regex to match block names or time names
// Regex to match Block names or Time names
hardforkPattern := []string{`.*Block$`, `.*Time$`}

for _, pat := range hardforkPattern {
Expand All @@ -451,7 +451,7 @@ func (g *Genesis) setDefaultHardforkValues(defaultConfig *params.ChainConfig) {
defaultConfigField := defaultConfigElem.Field(i)
fieldName := gConfigElem.Type().Field(i).Name

// Use the regex to check if the field is a Block field
// Use the regex to check if the field is a Block or Time field
if gConfigField.Kind() == reflect.Ptr && hardforkRegex.MatchString(fieldName) {
if gConfigField.IsNil() {
gConfigField.Set(defaultConfigField)
Expand All @@ -461,7 +461,7 @@ func (g *Genesis) setDefaultHardforkValues(defaultConfig *params.ChainConfig) {
}
}

// Hard fork block height specified in config.toml has higher priority, but
// Hard fork field specified in config.toml has higher priority, but
// if it is not specified in config.toml, use the default height in code.
func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
var defaultConfig *params.ChainConfig
Expand Down

0 comments on commit 1ebf2a4

Please sign in to comment.