eth/downloader: gracefully exit

This commit is contained in:
jsvisa 2025-09-18 00:06:42 +08:00 committed by Felix Lange
parent 4ed7a8a4a8
commit 5f4ac6757d

View file

@ -104,6 +104,9 @@ func (api *DownloaderAPI) eventLoop() {
if ev.Type == SyncStarted {
started = true
}
case <-sub.Err():
// The downloader is terminated or other internal error occurs
return
case <-checkTimer.C:
if !started {
checkTimer.Reset(checkInterval)