Merge pull request #2718 from lbryio/add-connected-to-wallet-status

add `connected` server to wallet status
This commit is contained in:
Jack Robison 2020-01-11 01:11:34 -05:00 committed by GitHub
commit ec8a61c3af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -112,7 +112,13 @@ class WalletComponent(Component):
return return
session_pool = self.wallet_manager.ledger.network.session_pool session_pool = self.wallet_manager.ledger.network.session_pool
sessions = session_pool.sessions sessions = session_pool.sessions
connected = None
if self.wallet_manager.ledger.network.client:
addr_and_port = self.wallet_manager.ledger.network.client.server_address_and_port
if addr_and_port:
connected = f"{addr_and_port[0]}:{addr_and_port[1]}"
result = { result = {
'connected': connected,
'servers': [ 'servers': [
{ {
'host': session.server[0], 'host': session.server[0],

View file

@ -772,6 +772,7 @@ class Daemon(metaclass=JSONRPCServerType):
'download_progress': (float) 0-100.0 'download_progress': (float) 0-100.0
}, },
'wallet': { 'wallet': {
'connected': (str) host and port of the connected spv server,
'blocks': (int) local blockchain height, 'blocks': (int) local blockchain height,
'blocks_behind': (int) remote_height - local_height, 'blocks_behind': (int) remote_height - local_height,
'best_blockhash': (str) block hash of most recent block, 'best_blockhash': (str) block hash of most recent block,