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:
Olaoluwa Osuntokun authored and GitHub committed 2019-04-22 16:01:28 -07:00
commit 6c4566bfce
2 files changed
+36 -18

No files matched your search

+16 -16
View File
@@ -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!")