diff --git a/eth/stagedsync/stage_headers.go b/eth/stagedsync/stage_headers.go index 05dcad492e8..f6c7ecb06ac 100644 --- a/eth/stagedsync/stage_headers.go +++ b/eth/stagedsync/stage_headers.go @@ -1175,6 +1175,8 @@ func WaitForDownloader(ctx context.Context, tx kv.RwTx, cfg HeadersCfg) error { // send all hashes to the Downloader service preverified := snapshotsCfg.Preverified var prevBytesCompleted uint64 + logEvery := time.NewTicker(logInterval) + defer logEvery.Stop() for _, p := range preverified { req := &proto_downloader.DownloadRequest{Items: make([]*proto_downloader.DownloadItem, 1)} req.Items[0] = &proto_downloader.DownloadItem{ @@ -1201,9 +1203,6 @@ func WaitForDownloader(ctx context.Context, tx kv.RwTx, cfg HeadersCfg) error { continue } - logEvery := time.NewTicker(logInterval) - defer logEvery.Stop() - // Print download progress until all segments are available Loop: for {