libp2p: moves discovery after host listen
Prevents the MDNS server from starting when the host has zero addresses. Re: https://github.com/libp2p/go-libp2p/issues/652 Signed-off-by: Sander Pick <sanderpick@gmail.com>
Sander Pick committed
Jun 5, 2019 at 20:32 UTC
f2635d1f5ecc30b587f922e7208c6bdf606d5185
1 file changed
+1
-1
core/node/groups.go
+1
-1
@@ -94,11 +94,11 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option {
94
BaseLibP2P,
95
96
fx.Provide(libp2p.AddrFilters(cfg.Swarm.AddrFilters)),
97
- fx.Invoke(libp2p.SetupDiscovery(cfg.Discovery.MDNS.Enabled, cfg.Discovery.MDNS.Interval)),
97
fx.Provide(libp2p.AddrsFactory(cfg.Addresses.Announce, cfg.Addresses.NoAnnounce)),
98
fx.Provide(libp2p.SmuxTransport(bcfg.getOpt("mplex"))),
99
fx.Provide(libp2p.Relay(cfg.Swarm.DisableRelay, cfg.Swarm.EnableRelayHop)),
100
fx.Invoke(libp2p.StartListening(cfg.Addresses.Swarm)),
101
+ fx.Invoke(libp2p.SetupDiscovery(cfg.Discovery.MDNS.Enabled, cfg.Discovery.MDNS.Interval)),
102
103
fx.Provide(libp2p.Security(!bcfg.DisableEncryptedConnections, cfg.Experimental.PreferTLS)),
104