trie: enforce strict per-depth fetch limit in Missing

This commit is contained in:
Forostovec 2025-11-15 21:56:08 +02:00 committed by GitHub
parent 5e6f7374de
commit f1f26be566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -368,7 +368,7 @@ func (s *Sync) Missing(max int) ([]string, []common.Hash, []common.Hash) {
// If we have too many already-pending tasks for this depth, throttle
depth := int(prio >> 56)
if s.fetches[depth] > maxFetchesPerDepth {
if s.fetches[depth] >= maxFetchesPerDepth {
break
}
// Item is allowed to be scheduled, add it to the task list