fix upnp edge case

-fixes https://github.com/lbryio/lbry/issues/1352
This commit is contained in:
Jack Robison 2018-08-09 08:39:17 -04:00
parent 108d2a033b
commit 0501f52805
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 7 additions and 2 deletions

View file

@ -20,6 +20,7 @@ at anytime.
* edge cases of http mirrored download of blobs
* ports with upnp redirects not showing the correct external port in log messages ( https://github.com/lbryio/lbry/issues/1338 )
* miniupnpc fallback issue in txupnp ( https://github.com/lbryio/lbry/issues/1341 )
* upnp error when disabled on router and a non-gateway is found, such as chromecast ( https://github.com/lbryio/lbry/issues/1352 )
### Deprecated
* automatic claim renew, this is no longer needed

View file

@ -683,8 +683,12 @@ class UPnPComponent(Component):
elif found and self.upnp.miniupnpc_runner:
log.warning("failed to set up redirect with txupnp, miniupnpc fallback was successful")
if found:
self.external_ip = yield self.upnp.get_external_ip()
yield self._setup_redirects()
try:
self.external_ip = yield self.upnp.get_external_ip()
yield self._setup_redirects()
except Exception as err:
log.warning("error trying to set up upnp: %s", err)
self.external_ip = CS.get_external_ip()
else:
self.external_ip = CS.get_external_ip()