Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dl: additional pre-check for having info #10853

Merged
merged 2 commits into from
Jun 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions erigon-lib/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,19 @@ func (d *Downloader) mainLoop(silent bool) error {

for _, t := range d.torrentClient.Torrents() {
if urls, ok := d.webseeds.ByFileName(t.Name()); ok {
// if we have created a torrent, but it has no info, assume that the
// webseed download either has not been called yet or has failed and
// try again here - otherwise the torrent will be left with no info
if t.Info() == nil {
ts, ok, err := d.webseeds.DownloadAndSaveTorrentFile(d.ctx, t.Name())
if ok && err == nil {
_, _, err = addTorrentFile(d.ctx, ts, d.torrentClient, d.db, d.webseeds)
if err != nil {
continue
}
}
}

t.AddWebSeeds(urls)
}
}
Expand Down
Loading