Merge pull request #22573 from holiman/checkfreq

core: fix condition on header verification
pull/22574/head
Péter Szilágyi 4 years ago committed by GitHub
commit 4adf0b9187
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      core/headerchain.go

@ -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

Loading…
Cancel
Save