windowSize should not exceed blocksync.MaxRequestLength
This commit is contained in:
parent
63a60cdd75
commit
806f7dd15f
@ -1487,8 +1487,14 @@ mainLoop:
|
||||
}
|
||||
|
||||
if i >= windowSize {
|
||||
windowSize += 10
|
||||
log.Infof("successfully fetched %d messages; increasing window size to %d", len(bstout), windowSize)
|
||||
newWindowSize := windowSize + 10
|
||||
if newWindowSize > int(blocksync.MaxRequestLength) {
|
||||
newWindowSize = int(blocksync.MaxRequestLength)
|
||||
}
|
||||
if newWindowSize > windowSize {
|
||||
windowSize = newWindowSize
|
||||
log.Infof("successfully fetched %d messages; increasing window size to %d", len(bstout), windowSize)
|
||||
}
|
||||
}
|
||||
|
||||
i -= batchSize
|
||||
|
Loading…
Reference in New Issue
Block a user