core/forkid: fix off-by-one bug (#22879)

* forkid: added failing test

* forkid: fixed off-by-one bug
This commit is contained in:
Shane Bammel
2021-05-18 03:37:18 -05:00
committed by GitHub
parent b7a91663ab
commit 32c1ed8a9c
2 changed files with 5 additions and 1 deletions

View File

@ -155,7 +155,7 @@ func newFilter(config *params.ChainConfig, genesis common.Hash, headfn func() ui
for i, fork := range forks {
// If our head is beyond this fork, continue to the next (we have a dummy
// fork of maxuint64 as the last item to always fail this check eventually).
if head > fork {
if head >= fork {
continue
}
// Found the first unpassed fork block, check if our current state matches