mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-04 21:56:49 +02:00
Added some additional comments
This commit is contained in:
committed by
Wilmer Paulino
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"
|
// Append the network type to the log directory so it is "namespaced"
|
||||||
// per network in the same fashion as the data directory.
|
// per network in the same fashion as the data directory.
|
||||||
cfg.LogDir = filepath.Join(cfg.LogDir,
|
cfg.LogDir = filepath.Join(cfg.LogDir,
|
||||||
|
@@ -303,10 +303,12 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
|
|||||||
// Gather external IPs from config
|
// Gather external IPs from config
|
||||||
externalIPs := cfg.ExternalIPs
|
externalIPs := cfg.ExternalIPs
|
||||||
|
|
||||||
|
// If enabled, use either UPnP or NAT-PMP to automatically configure
|
||||||
|
// port forwarding for users behind a NAT
|
||||||
if cfg.UpnpSupport {
|
if cfg.UpnpSupport {
|
||||||
|
|
||||||
externalIP, err := configureUpnp()
|
externalIP, err := configureUpnp()
|
||||||
if err != nil {
|
if err == nil {
|
||||||
externalIPs = append(externalIPs, externalIP)
|
externalIPs = append(externalIPs, externalIP)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,7 +317,7 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
|
|||||||
if cfg.NatPmp {
|
if cfg.NatPmp {
|
||||||
|
|
||||||
externalIP, err := configureNatPmp()
|
externalIP, err := configureNatPmp()
|
||||||
if err != nil {
|
if err == nil {
|
||||||
externalIPs = append(externalIPs, externalIP)
|
externalIPs = append(externalIPs, externalIP)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user