forked from LBRYCommunity/lbry-sdk
fix dht status error during startup
This commit is contained in:
parent
ba818354af
commit
c3b0151943
2 changed files with 2 additions and 1 deletions
|
@ -88,6 +88,7 @@ class BlobDownloader:
|
|||
if task and not task.done():
|
||||
task.cancel()
|
||||
await blob.close()
|
||||
log.info("downloaded %s", blob_hash[:8])
|
||||
return blob
|
||||
except asyncio.CancelledError:
|
||||
while self.active_connections:
|
||||
|
|
|
@ -349,7 +349,7 @@ class DHTComponent(Component):
|
|||
|
||||
async def get_status(self):
|
||||
return {
|
||||
'node_id': binascii.hexlify(self.dht_node.protocol.node_id),
|
||||
'node_id': None if not self.dht_node else binascii.hexlify(self.dht_node.protocol.node_id),
|
||||
'peers_in_routing_table': 0 if not self.dht_node else len(self.dht_node.protocol.routing_table.get_peers())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue