Browse Source

config: do not use New() which injects fallback

Signed-off-by: mudler <[email protected]>
mudler 1 year ago
parent
commit
aa77d99f3b
2 changed files with 3 additions and 1 deletions
  1. 2 0
      pkg/config/config.go
  2. 1 1
      pkg/node/connection.go

+ 2 - 0
pkg/config/config.go

@@ -284,6 +284,8 @@ func (c Config) ToOpts(l *logger.Logger) ([]node.Option, []vpn.Option, error) {
 		}
 		}
 
 
 		libp2pOpts = append(libp2pOpts, libp2p.ConnectionManager(cm))
 		libp2pOpts = append(libp2pOpts, libp2p.ConnectionManager(cm))
+	} else {
+		llger.Infof("connmanager disabled")
 	}
 	}
 
 
 	if !c.Limit.Enable || runtime.GOOS == "darwin" {
 	if !c.Limit.Enable || runtime.GOOS == "darwin" {

+ 1 - 1
pkg/node/connection.go

@@ -123,7 +123,7 @@ func (e *Node) genHost(ctx context.Context) (host.Host, error) {
 
 
 	opts = append(opts, FallbackDefaults)
 	opts = append(opts, FallbackDefaults)
 
 
-	return libp2p.New(opts...)
+	return libp2p.NewWithoutDefaults(opts...)
 }
 }
 
 
 // FallbackDefaults applies default options to the libp2p node if and only if no
 // FallbackDefaults applies default options to the libp2p node if and only if no