Merge pull request #2949 from wpaulino/lncfg-parse-network
lncfg: parse network for TCP addresses to listen on correct interface
This commit is contained in:
2 files changed
+36
-18
No files matched your search
@@ -920,22 +920,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(
|
||||
@@ -956,6 +940,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!")
|
||||
|
||||
Reference in new issue
Block a user