Added some additional comments
This commit is contained in:
parent
1c3df21d18
commit
ba0db4ce91
@ -725,6 +725,12 @@ func loadConfig() (*config, error) {
|
||||
)
|
||||
}
|
||||
|
||||
if cfg.UpnpSupport && cfg.NatPmp {
|
||||
str := "%s: Currently both Upnp and NAT-PMP cannot be " +
|
||||
"enabled together"
|
||||
return nil, fmt.Errorf(str, funcName)
|
||||
}
|
||||
|
||||
// Append the network type to the log directory so it is "namespaced"
|
||||
// per network in the same fashion as the data directory.
|
||||
cfg.LogDir = filepath.Join(cfg.LogDir,
|
||||
|
@ -303,10 +303,12 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
|
||||
// Gather external IPs from config
|
||||
externalIPs := cfg.ExternalIPs
|
||||
|
||||
// If enabled, use either UPnP or NAT-PMP to automatically configure
|
||||
// port forwarding for users behind a NAT
|
||||
if cfg.UpnpSupport {
|
||||
|
||||
externalIP, err := configureUpnp()
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
externalIPs = append(externalIPs, externalIP)
|
||||
}
|
||||
|
||||
@ -315,7 +317,7 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
|
||||
if cfg.NatPmp {
|
||||
|
||||
externalIP, err := configureNatPmp()
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
externalIPs = append(externalIPs, externalIP)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user