diff --git a/config.go b/config.go index eedcf8ff..75644321 100644 --- a/config.go +++ b/config.go @@ -919,22 +919,6 @@ func loadConfig() (*config, error) { cfg.RawListeners = append(cfg.RawListeners, addr) } - // For each of the RPC listeners (REST+gRPC), we'll ensure that users - // have specified a safe combo for authentication. If not, we'll bail - // out with an error. - err = lncfg.EnforceSafeAuthentication( - cfg.RPCListeners, !cfg.NoMacaroons, - ) - if err != nil { - return nil, err - } - err = lncfg.EnforceSafeAuthentication( - cfg.RESTListeners, !cfg.NoMacaroons, - ) - if err != nil { - return nil, err - } - // Add default port to all RPC listener addresses if needed and remove // duplicate addresses. cfg.RPCListeners, err = lncfg.NormalizeAddresses( @@ -955,6 +939,22 @@ func loadConfig() (*config, error) { return nil, err } + // For each of the RPC listeners (REST+gRPC), we'll ensure that users + // have specified a safe combo for authentication. If not, we'll bail + // out with an error. + err = lncfg.EnforceSafeAuthentication( + cfg.RPCListeners, !cfg.NoMacaroons, + ) + if err != nil { + return nil, err + } + err = lncfg.EnforceSafeAuthentication( + cfg.RESTListeners, !cfg.NoMacaroons, + ) + if err != nil { + return nil, err + } + // Remove the listening addresses specified if listening is disabled. if cfg.DisableListen { ltndLog.Infof("Listening on the p2p interface is disabled!")