From f2635d1f5ecc30b587f922e7208c6bdf606d5185 Mon Sep 17 00:00:00 2001 From: Sander Pick Date: Wed, 5 Jun 2019 20:32:51 -0700 Subject: [PATCH] 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 --- core/node/groups.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/node/groups.go b/core/node/groups.go index 5e84b9a5838..1e5207b898c 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -94,11 +94,11 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option { BaseLibP2P, fx.Provide(libp2p.AddrFilters(cfg.Swarm.AddrFilters)), - fx.Invoke(libp2p.SetupDiscovery(cfg.Discovery.MDNS.Enabled, cfg.Discovery.MDNS.Interval)), fx.Provide(libp2p.AddrsFactory(cfg.Addresses.Announce, cfg.Addresses.NoAnnounce)), fx.Provide(libp2p.SmuxTransport(bcfg.getOpt("mplex"))), fx.Provide(libp2p.Relay(cfg.Swarm.DisableRelay, cfg.Swarm.EnableRelayHop)), fx.Invoke(libp2p.StartListening(cfg.Addresses.Swarm)), + fx.Invoke(libp2p.SetupDiscovery(cfg.Discovery.MDNS.Enabled, cfg.Discovery.MDNS.Interval)), fx.Provide(libp2p.Security(!bcfg.DisableEncryptedConnections, cfg.Experimental.PreferTLS)),