Skip to content

Commit

Permalink
remove deprecated StaticRelays option
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Nov 9, 2022
1 parent 0575c19 commit 9167a07
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,6 @@ func EnableAutoRelay(opts ...autorelay.Option) Option {
}
}

// StaticRelays configures known relays for autorelay; when this option is enabled
// then the system will use the configured relays instead of querying the DHT to
// discover relays.
// Deprecated: pass an autorelay.WithStaticRelays option to EnableAutoRelay.
func StaticRelays(relays []peer.AddrInfo) Option {
return func(cfg *Config) error {
cfg.AutoRelayOpts = append(cfg.AutoRelayOpts, autorelay.WithStaticRelays(relays))
return nil
}
}

// DefaultStaticRelays configures the static relays to use the known PL-operated relays.
// Deprecated: pass autorelay.WithDefaultStaticRelays to EnableAutoRelay.
func DefaultStaticRelays() Option {
Expand All @@ -281,7 +270,10 @@ func DefaultStaticRelays() Option {
}
relays = append(relays, *pi)
}
return StaticRelays(relays)
return func(cfg *Config) error {
cfg.AutoRelayOpts = append(cfg.AutoRelayOpts, autorelay.WithStaticRelays(relays))
return nil
}
}

// ForceReachabilityPublic overrides automatic reachability detection in the AutoNAT subsystem,
Expand Down

0 comments on commit 9167a07

Please sign in to comment.