allow erigon download .torrent from webseed by default (#9052)

This commit is contained in:
Alex Sharov 2023-12-22 11:42:35 +07:00 committed by GitHub
parent 95434d100e
commit 657aafd5b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 3 deletions

View File

@ -763,7 +763,6 @@ func (d *DownloadSnapshots) Run(ctx *Context) error {
if err != nil {
return err
}
downloaderCfg.DownloadTorrentFilesFromWebseed = true
downlo, err := downloader.New(ctx, downloaderCfg, dirs, log.Root(), log.LvlInfo, true)
if err != nil {
return err

View File

@ -198,7 +198,6 @@ func Downloader(ctx context.Context, logger log.Logger) error {
}
downloadernat.DoNat(natif, cfg.ClientConfig, logger)
cfg.DownloadTorrentFilesFromWebseed = true // enable it only for standalone mode now. feature is not fully ready yet
d, err := downloader.New(ctx, cfg, dirs, logger, log.LvlInfo, seedbox)
if err != nil {
return err

View File

@ -192,7 +192,7 @@ func New(dirs datadir.Dirs, version string, verbosity lg.Level, downloadRate, up
return &Cfg{Dirs: dirs, ChainName: chainName,
ClientConfig: torrentConfig, DownloadSlots: downloadSlots,
WebSeedUrls: webseedHttpProviders, WebSeedFiles: webseedFileProviders, WebSeedS3Tokens: webseedS3Providers,
DownloadTorrentFilesFromWebseed: false, ExpectedTorrentFilesHashes: snapCfg.Preverified,
DownloadTorrentFilesFromWebseed: true, ExpectedTorrentFilesHashes: snapCfg.Preverified,
}, nil
}

View File

@ -239,6 +239,7 @@ func (d *WebSeeds) downloadTorrentFilesFromProviders(ctx context.Context, rootDi
}
var addedNew int
e, ctx := errgroup.WithContext(ctx)
e.SetLimit(1024)
urlsByName := d.TorrentUrls()
//TODO:
// - what to do if node already synced?