update status command
This commit is contained in:
parent
6b6a29fdb7
commit
4e29041291
1 changed files with 9 additions and 13 deletions
|
@ -735,8 +735,7 @@ class Daemon(AuthJSONRPCServer):
|
||||||
'is_running': bool,
|
'is_running': bool,
|
||||||
'is_first_run': bool,
|
'is_first_run': bool,
|
||||||
'startup_status': {
|
'startup_status': {
|
||||||
'code': status code,
|
(str) component_name: (bool) True if running else False,
|
||||||
'message': status message
|
|
||||||
},
|
},
|
||||||
'connection_status': {
|
'connection_status': {
|
||||||
'code': connection status code,
|
'code': connection status code,
|
||||||
|
@ -760,22 +759,19 @@ class Daemon(AuthJSONRPCServer):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# on startup, the wallet or network won't be available but we still need this call to work
|
# on startup, the wallet or network won't be available but we still need this call to work
|
||||||
has_wallet = self.session and self.session.wallet and self.session.wallet.network
|
has_wallet = self.session and self.wallet and self.wallet.network
|
||||||
local_height = self.session.wallet.network.get_local_height() if has_wallet else 0
|
local_height = self.wallet.network.get_local_height() if has_wallet else 0
|
||||||
remote_height = self.session.wallet.network.get_server_height() if has_wallet else 0
|
remote_height = self.wallet.network.get_server_height() if has_wallet else 0
|
||||||
best_hash = (yield self.session.wallet.get_best_blockhash()) if has_wallet else None
|
best_hash = (yield self.wallet.get_best_blockhash()) if has_wallet else None
|
||||||
wallet_is_encrypted = has_wallet and self.session.wallet.wallet and \
|
wallet_is_encrypted = has_wallet and self.wallet.wallet and \
|
||||||
self.session.wallet.wallet.use_encryption
|
self.wallet.wallet.use_encryption
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
'lbry_id': base58.b58encode(self.node_id),
|
'lbry_id': base58.b58encode(self.node_id),
|
||||||
'installation_id': conf.settings.installation_id,
|
'installation_id': conf.settings.installation_id,
|
||||||
'is_running': self.announced_startup,
|
'is_running': self.announced_startup,
|
||||||
'is_first_run': self.session.wallet.is_first_run if has_wallet else None,
|
'is_first_run': self.wallet.is_first_run if has_wallet else None,
|
||||||
'startup_status': {
|
'startup_status': self.component_manager.get_components_status(),
|
||||||
'code': self.startup_status[0],
|
|
||||||
'message': self.startup_status[1],
|
|
||||||
},
|
|
||||||
'connection_status': {
|
'connection_status': {
|
||||||
'code': self.connection_status_code,
|
'code': self.connection_status_code,
|
||||||
'message': (
|
'message': (
|
||||||
|
|
Loading…
Add table
Reference in a new issue