Added some additional comments

This commit is contained in:
John Griffith 2018-01-21 17:22:13 +00:00 committed by Wilmer Paulino
parent 1c3df21d18
commit ba0db4ce91
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F
2 changed files with 10 additions and 2 deletions

View File

@ -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,

View File

@ -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)
}