From d359949a5c7ad66accb54cd279b19c4c92f76c17 Mon Sep 17 00:00:00 2001 From: jobevers Date: Tue, 21 Feb 2017 15:30:36 -0600 Subject: [PATCH] check network exists on jsonrpc_status call --- CHANGELOG.md | 2 ++ lbrynet/lbrynet_daemon/Daemon.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d2858ad..c5bf53ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ can and probably will change functionality and break backwards compatability at anytime. ## [Unreleased] +### Changed + * Add blockchain status to jsonrpc_status ## [0.8.7] - 2017-02-21 diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 59fd095b7..9a4e63ac8 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -1116,7 +1116,8 @@ class Daemon(AuthJSONRPCServer): Returns: daemon status """ - has_wallet = self.session and self.session.wallet + # 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 local_height = self.session.wallet.network.get_local_height() if has_wallet else 0 remote_height = self.session.wallet.network.get_server_height() if has_wallet else 0 best_hash = (yield self.session.wallet.get_best_blockhash()) if has_wallet else None