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