remove null handling used to fix a now resolved bug, update daemon_status outputs per alex's suggestions

This commit is contained in:
Jack 2016-04-13 23:10:17 -04:00
parent 8b966c61d8
commit 6b9f1d519e

View file

@ -229,7 +229,7 @@ class LBRYDaemon(jsonrpc.JSONRPC):
else:
request.setHeader("Access-Control-Allow-Origin", "*")
request.setHeader("content-type", "text/json")
if args == [{}] or args == [None]:
if args == [{}]:
d = defer.maybeDeferred(function)
else:
d = defer.maybeDeferred(function, *args)
@ -928,13 +928,10 @@ class LBRYDaemon(jsonrpc.JSONRPC):
if status_code is 'loading_wallet', also contains key 'progress': blockchain catchup progress
"""
r = {'status_code': self.startup_status[0], 'status_message': self.startup_status[1]}
try:
r = {'code': self.startup_status[0], 'message': self.startup_status[1], 'progress': None}
if self.startup_status[0] == 'loading_wallet':
r['status_message'] = r['status_message'] % (str(self.session.wallet.blocks_behind_alert) + " blocks behind")
r['message'] = r['message'] % (str(self.session.wallet.blocks_behind_alert) + " blocks behind")
r['progress'] = self.session.wallet.catchup_progress
except:
pass
log.info("[" + str(datetime.now()) + "] daemon status: " + str(r))
return self._render_response(r, OK_CODE)