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

webseed: remove dependency on db state #9051

Merged
merged 1 commit into from
Dec 22, 2023
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
12 changes: 1 addition & 11 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -1190,22 +1190,12 @@ func (s *Ethereum) setUpSnapDownloader(ctx context.Context, downloaderCfg *downl
if s.config.Snapshot.NoDownloader {
return nil
}
var discover bool
if err := s.chainDB.View(ctx, func(tx kv.Tx) error {
p, err := stages.GetStageProgress(tx, stages.Snapshots)
if err != nil {
return err
}
discover = p == 0
return nil
}); err != nil {
return err
}
if s.config.Snapshot.DownloaderAddr != "" {
// connect to external Downloader
s.downloaderClient, err = downloadergrpc.NewClient(ctx, s.config.Snapshot.DownloaderAddr)
} else {
// start embedded Downloader
discover := true
s.downloader, err = downloader3.New(ctx, downloaderCfg, s.config.Dirs, s.logger, log.LvlDebug, discover)
if err != nil {
return err
Expand Down
Loading