diff --git a/lbry/extras/daemon/components.py b/lbry/extras/daemon/components.py index e55ec342d..822022f32 100644 --- a/lbry/extras/daemon/components.py +++ b/lbry/extras/daemon/components.py @@ -481,6 +481,10 @@ class UPnPComponent(Component): log.info("external ip changed from %s to %s", self.external_ip, external_ip) if external_ip: self.external_ip = external_ip + dht_component = self.component_manager.get_component(DHT_COMPONENT) + if dht_component: + dht_node = dht_component.component + dht_node.protocol.external_ip = external_ip # assert self.external_ip is not None # TODO: handle going/starting offline if not self.upnp_redirects and self.upnp: # setup missing redirects diff --git a/tests/unit/dht/test_node.py b/tests/unit/dht/test_node.py index a5e599f9b..75f999a75 100644 --- a/tests/unit/dht/test_node.py +++ b/tests/unit/dht/test_node.py @@ -1,4 +1,5 @@ import asyncio +import time import unittest import typing from lbry.testcase import AsyncioTestCase @@ -92,11 +93,11 @@ class TestNodePingQueueDiscover(AsyncioTestCase): class TestTemporarilyLosingConnection(AsyncioTestCase): - @unittest.SkipTest + TIMEOUT = None # not supported as it advances time async def test_losing_connection(self): async def wait_for(check_ok, insist, timeout=20): - start = loop.time() - while loop.time() - start < timeout: + start = time.time() + while time.time() - start < timeout: if check_ok(): break await asyncio.sleep(0)