Unverified Commit 4adf0b91 authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub

Merge pull request #22573 from holiman/checkfreq

core: fix condition on header verification
parents bed74b38 497448bf
...@@ -323,7 +323,7 @@ func (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header, checkFreq int) ...@@ -323,7 +323,7 @@ func (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header, checkFreq int)
seals := make([]bool, len(chain)) seals := make([]bool, len(chain))
if checkFreq != 0 { if checkFreq != 0 {
// In case of checkFreq == 0 all seals are left false. // 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) index := i*checkFreq + hc.rand.Intn(checkFreq)
if index >= len(seals) { if index >= len(seals) {
index = len(seals) - 1 index = len(seals) - 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment