core: fix condition on header verification

This commit is contained in:
Martin Holst Swende 2021-03-25 11:50:14 +01:00
parent 0fda25e471
commit 497448bf90
No known key found for this signature in database
GPG Key ID: 683B438C05A5DDF0

@ -323,7 +323,7 @@ func (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header, checkFreq int)
seals := make([]bool, len(chain))
if checkFreq != 0 {
// In case of checkFreq == 0 all seals are left false.
for i := 0; i < len(seals)/checkFreq; i++ {
for i := 0; i <= len(seals)/checkFreq; i++ {
index := i*checkFreq + hc.rand.Intn(checkFreq)
if index >= len(seals) {
index = len(seals) - 1