fix upnp and peer port setup

This commit is contained in:
Jack Robison 2018-08-05 13:12:39 -04:00
parent 049936f4a6
commit 9511040d5a
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -573,7 +573,7 @@ class PeerProtocolServerComponent(Component):
@defer.inlineCallbacks @defer.inlineCallbacks
def start(self): def start(self):
wallet = self.component_manager.get_component(WALLET_COMPONENT) wallet = self.component_manager.get_component(WALLET_COMPONENT)
peer_port = self.component_manager.get_component(UPNP_COMPONENT).upnp_redirects["TCP"] peer_port = self.component_manager.get_component(UPNP_COMPONENT).get_redirects()[0]
query_handlers = { query_handlers = {
handler.get_primary_query_identifier(): handler for handler in [ handler.get_primary_query_identifier(): handler for handler in [
BlobRequestHandlerFactory( BlobRequestHandlerFactory(
@ -675,6 +675,8 @@ class UPnPComponent(Component):
@defer.inlineCallbacks @defer.inlineCallbacks
def start(self): def start(self):
if not self.use_upnp:
return
log.debug("In _try_upnp") log.debug("In _try_upnp")
found = yield self.upnp.discover() found = yield self.upnp.discover()
if found and not self.upnp.miniupnpc_runner: if found and not self.upnp.miniupnpc_runner: