Skip to content

Commit

Permalink
StageSnapshot struck: fix "no metadata yet" (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx authored Feb 25, 2025
1 parent c73ac69 commit 1ad66a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erigon-lib/downloader/webseed.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ func (d *WebSeeds) DownloadAndSaveTorrentFile(ctx context.Context, name string)
continue // it's ok if some HTTP provider failed - try next one
}
res, err := d.callTorrentHttpProvider(ctx, parsedUrl, name)
if err != nil {
if err != nil || res == nil {
d.logger.Debug("[snapshots] .torrent from webseed rejected", "name", name, "err", err, "url", urlStr)
continue // it's ok if some HTTP provider failed - try next one
}
Expand All @@ -670,7 +670,7 @@ func (d *WebSeeds) callTorrentHttpProvider(ctx context.Context, url *url.URL, fi
request = request.WithContext(ctx)
resp, err := d.client.Do(request)
if err != nil {
return nil, fmt.Errorf("webseed.downloadTorrentFile: url=%s, %w", url.String(), err)
return nil, nil
}
defer resp.Body.Close()
//protect against too small and too big data
Expand Down

0 comments on commit 1ad66a5

Please sign in to comment.