Update config.go

This commit is contained in:
Felix Lange 2024-04-04 11:56:47 +02:00 committed by GitHub
parent c53ce79a3a
commit 88b449d321
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -138,10 +138,10 @@ func (c *ChainConfig) AddFork(name string, epoch uint64, version []byte) *ChainC
knownIndex := slices.Index(knownForks, name) knownIndex := slices.Index(knownForks, name)
if knownIndex == -1 { if knownIndex == -1 {
knownIndex = math.MaxInt // assume that the unknown fork happens after the known ones knownIndex = math.MaxInt // assume that the unknown fork happens after the known ones
} if epoch != math.MaxUint64 {
if knownIndex == math.MaxInt && epoch != math.MaxUint64 {
log.Warn("Unknown fork in config.yaml", "fork name", name, "known forks", knownForks) log.Warn("Unknown fork in config.yaml", "fork name", name, "known forks", knownForks)
} }
}
fork := &Fork{ fork := &Fork{
Name: name, Name: name,
Epoch: epoch, Epoch: epoch,
@ -149,7 +149,6 @@ func (c *ChainConfig) AddFork(name string, epoch uint64, version []byte) *ChainC
knownIndex: knownIndex, knownIndex: knownIndex,
} }
fork.computeDomain(c.GenesisValidatorsRoot) fork.computeDomain(c.GenesisValidatorsRoot)
c.Forks = append(c.Forks, fork) c.Forks = append(c.Forks, fork)
sort.Sort(c.Forks) sort.Sort(c.Forks)
return c return c