Skip to content

BlockFetcher.rescheduleFetch

Source (upstream pre-purge) Current
File eth/fetcher/block_fetcher.go block_fetcher_pow.go
Symbol BlockFetcher.rescheduleFetch BlockFetcher.rescheduleFetch
Ref f4d53133f~1 etc/v1.17.3-full-node

3-way merge — purge → getc ← upstream

pre-purge
// rescheduleFetch resets the specified fetch timer to the next blockAnnounce timeout.
func (f *BlockFetcher) rescheduleFetch(fetch *time.Timer) {
// Short circuit if no blocks are announced
if len(f.announced) == 0 {
return
}
// Schedule announcement retrieval quickly for light mode
// since server won't send any headers to client.
if f.light {
fetch.Reset(lightTimeout)
return
}
// Otherwise find the earliest expiring announcement
earliest := time.Now()
for _, announces := range f.announced {
if earliest.After(announces[0].time) {
earliest = announces[0].time
}
}
fetch.Reset(arriveTimeout - time.Since(earliest))
}
core-geth validation — **Identical** ✅ | | | |---|---| | File | [`block_fetcher.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/fetcher/block_fetcher.go) | | Symbol | `BlockFetcher.rescheduleFetch` | | Ref | `v1.12.20` |

← Sync & Downloader