swarm: deprecate libp2p.DialRanker option (#2430)

* swarm: deprecate libp2p.DialRanker option

* remove whitespace diff

* Apply suggestions from code review

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
This commit is contained in:
Sukun
2023-07-14 11:46:12 +05:30
committed by GitHub
parent 70c19cbce3
commit 381f23057b
3 changed files with 6 additions and 5 deletions

View File

@@ -178,12 +178,9 @@ func (cfg *Config) makeSwarm(eventBus event.Bus, enableMetrics bool) (*swarm.Swa
if cfg.MultiaddrResolver != nil {
opts = append(opts, swarm.WithMultiaddrResolver(cfg.MultiaddrResolver))
}
dialRanker := cfg.DialRanker
if dialRanker == nil {
dialRanker = swarm.DefaultDialRanker
if cfg.DialRanker != nil {
opts = append(opts, swarm.WithDialRanker(cfg.DialRanker))
}
opts = append(opts, swarm.WithDialRanker(dialRanker))
if enableMetrics {
opts = append(opts,