add connected server to wallet status

This commit is contained in:
Jack Robison 2020-01-11 00:12:52 -05:00
parent b34f44c867
commit 0315eaff8a
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 7 additions and 0 deletions

View file

@ -112,7 +112,13 @@ class WalletComponent(Component):
return
session_pool = self.wallet_manager.ledger.network.session_pool
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 = {
'connected': connected,
'servers': [
{
'host': session.server[0],

View file

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