diff --git a/eth/stagedsync/stage_headers.go b/eth/stagedsync/stage_headers.go index 923b5f5ed0c..226fca3c850 100644 --- a/eth/stagedsync/stage_headers.go +++ b/eth/stagedsync/stage_headers.go @@ -1196,6 +1196,9 @@ func WaitForDownloader(ctx context.Context, tx kv.RwTx, cfg HeadersCfg) error { time.Sleep(10 * time.Second) continue } + if _, err := cfg.snapshotDownloader.Stats(ctx, &proto_downloader.StatsRequest{}); err != nil { + log.Warn("Error while waiting for snapshots progress", "err", err) + } break } // Now send all info hashes 1 by one @@ -1220,12 +1223,6 @@ func WaitForDownloader(ctx context.Context, tx kv.RwTx, cfg HeadersCfg) error { } log.Info("Requested download", "file", p.Name) - if reply, err := cfg.snapshotDownloader.Stats(ctx, &proto_downloader.StatsRequest{}); err != nil { - log.Warn("Error while waiting for snapshots progress", "err", err) - } else if reply.Completed { - continue - } - // Print download progress until all segments are available Loop: for {