Skip to content

Commit

Permalink
cmd/utils: use @snap discovery URL for snap-discovery config
Browse files Browse the repository at this point in the history
We have all.classic.blockd.info AND
snap.classic.blockd.info, so let's use
both of them in reasonable places.

Date: 2023-11-02 17:02:45-06:00
Signed-off-by: meows <[email protected]>
  • Loading branch information
meowsbits committed Nov 2, 2023
1 parent 8011c59 commit 9bdf2fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2244,14 +2244,16 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {

// SetDNSDiscoveryDefaults2 configures DNS discovery with the given URL if no URLs are set.
func SetDNSDiscoveryDefaults2(cfg *ethconfig.Config, url string) {
var ethURL = url
if cfg.EthDiscoveryURLs != nil {
log.Warn("Short circuiting DNS discovery defaults (should be manually configured)")
return
}
if cfg.SyncMode == downloader.LightSync {
url = strings.Replace(url, "@all.", "@les.", 1)
ethURL = strings.Replace(url, "@all.", "@les.", 1)
}
cfg.EthDiscoveryURLs = []string{url}
cfg.SnapDiscoveryURLs = cfg.EthDiscoveryURLs
cfg.EthDiscoveryURLs = []string{ethURL}
cfg.SnapDiscoveryURLs = []string{strings.Replace(url, "@all.", "@snap.", 1)}
}

// SetDNSDiscoveryDefaults configures DNS discovery with the given URL if
Expand Down

0 comments on commit 9bdf2fa

Please sign in to comment.