From 5f4ac6757d07d964a54eca82fd506324a662b7ae Mon Sep 17 00:00:00 2001 From: jsvisa Date: Thu, 18 Sep 2025 00:06:42 +0800 Subject: [PATCH] eth/downloader: gracefully exit --- eth/downloader/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/downloader/api.go b/eth/downloader/api.go index 7a2c028753..6033e44474 100644 --- a/eth/downloader/api.go +++ b/eth/downloader/api.go @@ -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)