Merge pull request #1498 from yaslama/fix-1488
Fix the ability to disable p2p listening
This commit is contained in:
commit
d83f4fbb85
15
config.go
15
config.go
@ -830,13 +830,6 @@ func loadConfig() (*config, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Remove the listening addresses specified if listening is disabled.
|
||||
if cfg.DisableListen {
|
||||
ltndLog.Infof("Listening on the p2p interface is disabled!")
|
||||
cfg.Listeners = nil
|
||||
cfg.ExternalIPs = nil
|
||||
}
|
||||
|
||||
// Add default port to all RPC listener addresses if needed and remove
|
||||
// duplicate addresses.
|
||||
cfg.RPCListeners, err = lncfg.NormalizeAddresses(
|
||||
@ -857,6 +850,13 @@ func loadConfig() (*config, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Remove the listening addresses specified if listening is disabled.
|
||||
if cfg.DisableListen {
|
||||
ltndLog.Infof("Listening on the p2p interface is disabled!")
|
||||
cfg.Listeners = nil
|
||||
cfg.ExternalIPs = nil
|
||||
} else {
|
||||
|
||||
// Add default port to all listener addresses if needed and remove
|
||||
// duplicate addresses.
|
||||
cfg.Listeners, err = lncfg.NormalizeAddresses(
|
||||
@ -888,6 +888,7 @@ func loadConfig() (*config, error) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, ensure that we are only listening on localhost if Tor
|
||||
// inbound support is enabled.
|
||||
|
Loading…
Reference in New Issue
Block a user