Fix UPnP log spam on networks without UPnP IGDs (see #893)

We should only run the UPnP port mapping renewal routine if the initial
discovery and configuration succeed. This commit applies that logic.
This commit is contained in:
Caleb Callaway 2014-10-22 18:44:13 -07:00
parent 27448bde20
commit 4183044e96

View File

@ -712,13 +712,13 @@ func setupUPnP() {
l.Warnln("Failed to create UPnP port mapping") l.Warnln("Failed to create UPnP port mapping")
} else { } else {
l.Infof("Created UPnP port mapping for external port %d on UPnP device %s.", externalPort, igd.FriendlyIdentifier()) l.Infof("Created UPnP port mapping for external port %d on UPnP device %s.", externalPort, igd.FriendlyIdentifier())
}
}
if opts.UPnPRenewal > 0 { if opts.UPnPRenewal > 0 {
go renewUPnP(port) go renewUPnP(port)
} }
} }
}
}
} else { } else {
l.Warnln("Multiple listening addresses; not attempting UPnP port mapping") l.Warnln("Multiple listening addresses; not attempting UPnP port mapping")
} }