core/forkid: skip all time based forks in genesis using loop

This commit is contained in:
lightclient 2023-08-31 07:17:19 -07:00
parent e27464ada2
commit b47f835c54
No known key found for this signature in database
GPG key ID: 75C916AFEE20183E

View file

@ -293,7 +293,7 @@ func gatherForks(config *params.ChainConfig, genesis uint64) ([]uint64, []uint64
forksByTime = forksByTime[1:]
}
// Skip any forks by time that are non-zero, but before genesis.
if len(forksByTime) > 0 && forksByTime[0] <= genesis {
for len(forksByTime) > 0 && forksByTime[0] <= genesis {
forksByTime = forksByTime[1:]
}
return forksByBlock, forksByTime