From 6e3a25d2552082ab5832d37eca1c810e241626b2 Mon Sep 17 00:00:00 2001 From: jessop Date: Mon, 25 Nov 2019 10:36:51 -0500 Subject: [PATCH] status: wallet returns all servers rather than just available --- lbry/lbry/extras/daemon/Components.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lbry/lbry/extras/daemon/Components.py b/lbry/lbry/extras/daemon/Components.py index 4d1600af7..f207e1aa4 100644 --- a/lbry/lbry/extras/daemon/Components.py +++ b/lbry/lbry/extras/daemon/Components.py @@ -115,13 +115,13 @@ class WalletComponent(Component): best_hash = self.wallet_manager.get_best_blockhash() progress = min(max(math.ceil(float(local_height) / float(remote_height) * 100), 0), 100) return { - 'connected_servers': [ + 'servers': [ { 'host': session.server[0], 'port': session.server[1], - 'latency': round(session.connection_latency, 2), + 'latency': round(session.connection_latency, 2) if session.connection_latency else None, + 'availability': session.available, } for session in sessions - if session and session.available ], 'headers_synchronization_progress': progress, 'blocks': max(local_height, 0), @@ -132,6 +132,14 @@ class WalletComponent(Component): } else: return { + 'servers': [ + { + 'host': session.server[0], + 'port': session.server[1], + 'latency': round(session.connection_latency, 2) if session.connection_latency else None, + 'availability': session.available, + } for session in sessions + ], 'known_servers': len(sessions), 'available_servers': sum(s.available is True for s in sessions) }