Skip to content

Commit

Permalink
fix config parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Oct 27, 2021
1 parent bc7e3c4 commit aea6155
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ type Config struct {
EnableQUIC bool
EnableNATPortMap bool
EnableMDNS bool
MDNSIntervalSeconds int
EnablePubSubPeerExchange bool
EnablePubSubFloodPublish bool
}
Expand All @@ -54,9 +53,6 @@ func setDefaults(conf *Config) {
if conf.ConnManager == nil {
conf.ConnManager = connmgr.NewConnManager(256, 512, time.Second*120)
}
if conf.MDNSIntervalSeconds <= 0 {
conf.MDNSIntervalSeconds = 1
}
}

// Info contains public information about the libp2p peer.
Expand Down Expand Up @@ -167,11 +163,9 @@ func New(conf Config) (*Peer, error) {
}

if conf.EnableMDNS {
if err := mdns.Start(ctx, p.host, conf.MDNSIntervalSeconds); err != nil {
if err := mdns.Start(ctx, p.host); err != nil {
return nil, fin.Cleanupf("enabling mdns: %v", err)
}

log.Infof("mdns was enabled (interval=%ds)", conf.MDNSIntervalSeconds)
}

return p, nil
Expand Down

0 comments on commit aea6155

Please sign in to comment.