diff --git a/lbrynet/extras/daemon/Components.py b/lbrynet/extras/daemon/Components.py index 15578b9e5..bf5c8fb51 100644 --- a/lbrynet/extras/daemon/Components.py +++ b/lbrynet/extras/daemon/Components.py @@ -434,7 +434,7 @@ class HashAnnouncerComponent(Component): class StreamManagerComponent(Component): component_name = STREAM_MANAGER_COMPONENT - depends_on = [BLOB_COMPONENT, DATABASE_COMPONENT, WALLET_COMPONENT, DHT_COMPONENT] + depends_on = [BLOB_COMPONENT, DATABASE_COMPONENT, WALLET_COMPONENT] def __init__(self, component_manager): super().__init__(component_manager) @@ -455,8 +455,10 @@ class StreamManagerComponent(Component): blob_manager = self.component_manager.get_component(BLOB_COMPONENT) storage = self.component_manager.get_component(DATABASE_COMPONENT) wallet = self.component_manager.get_component(WALLET_COMPONENT) - node = self.component_manager.get_component(DHT_COMPONENT) - + try: + node = self.component_manager.get_component(DHT_COMPONENT) + except NameError: + node = None log.info('Starting the file manager') loop = asyncio.get_event_loop() self.stream_manager = StreamManager( diff --git a/lbrynet/stream/stream_manager.py b/lbrynet/stream/stream_manager.py index 313a25e2b..fadda258f 100644 --- a/lbrynet/stream/stream_manager.py +++ b/lbrynet/stream/stream_manager.py @@ -44,8 +44,8 @@ comparison_operators = { class StreamManager: def __init__(self, loop: asyncio.BaseEventLoop, blob_manager: 'BlobFileManager', wallet: 'LbryWalletManager', - storage: 'SQLiteStorage', node: 'Node', peer_timeout: float, peer_connect_timeout: float, - fixed_peers: typing.Optional[typing.List['KademliaPeer']] = None): + storage: 'SQLiteStorage', node: typing.Optional['Node'], peer_timeout: float, + peer_connect_timeout: float, fixed_peers: typing.Optional[typing.List['KademliaPeer']] = None): self.loop = loop self.blob_manager = blob_manager self.wallet = wallet @@ -79,6 +79,9 @@ class StreamManager: self.streams.add(stream) async def resume(self): + if not self.node: + log.warning("no DHT node given, cannot resume downloads") + return await self.node.joined.wait() resumed = 0 for stream in self.streams: