mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-08-23 17:27:25 +00:00
fix wallet component
This commit is contained in:
parent
3019a1c222
commit
e02e2a249a
2 changed files with 4 additions and 5 deletions
|
@ -329,19 +329,18 @@ class WalletComponent(Component):
|
||||||
def component(self):
|
def component(self):
|
||||||
return self.wallet_manager
|
return self.wallet_manager
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
|
||||||
def get_status(self):
|
def get_status(self):
|
||||||
if self.wallet_manager:
|
if self.wallet_manager:
|
||||||
local_height = self.wallet_manager.network.get_local_height()
|
local_height = self.wallet_manager.network.get_local_height()
|
||||||
remote_height = self.wallet_manager.network.get_server_height()
|
remote_height = self.wallet_manager.network.get_server_height()
|
||||||
best_hash = yield f2d(self.wallet_manager.get_best_blockhash())
|
best_hash = self.wallet_manager.get_best_blockhash()
|
||||||
defer.returnValue({
|
return {
|
||||||
'blocks': max(local_height, 0),
|
'blocks': max(local_height, 0),
|
||||||
'blocks_behind': max(remote_height - local_height, 0),
|
'blocks_behind': max(remote_height - local_height, 0),
|
||||||
'best_blockhash': best_hash,
|
'best_blockhash': best_hash,
|
||||||
'is_encrypted': self.wallet_manager.wallet.use_encryption,
|
'is_encrypted': self.wallet_manager.wallet.use_encryption,
|
||||||
'is_locked': not self.wallet_manager.is_wallet_unlocked,
|
'is_locked': not self.wallet_manager.is_wallet_unlocked,
|
||||||
})
|
}
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def start(self):
|
def start(self):
|
||||||
|
|
|
@ -457,7 +457,7 @@ class AuthJSONRPCServer(AuthorizedBase):
|
||||||
else:
|
else:
|
||||||
d = defer.succeed(result)
|
d = defer.succeed(result)
|
||||||
except:
|
except:
|
||||||
d = Failure(captureVars=Deferred.debug)
|
d = defer.fail(Failure(captureVars=Deferred.debug))
|
||||||
|
|
||||||
# finished_deferred will callback when the request is finished
|
# finished_deferred will callback when the request is finished
|
||||||
# and errback if something went wrong. If the errback is
|
# and errback if something went wrong. If the errback is
|
||||||
|
|
Loading…
Add table
Reference in a new issue