fix resolve_name for asyncio

This commit is contained in:
Victor Shyba 2018-10-17 16:34:45 -03:00 committed by Lex Berezhny
parent f049109a38
commit 8754c6fabe

View file

@ -1610,8 +1610,7 @@ class Daemon(AuthJSONRPCServer):
defer.returnValue(response) defer.returnValue(response)
@requires(WALLET_COMPONENT) @requires(WALLET_COMPONENT)
@defer.inlineCallbacks async def jsonrpc_resolve_name(self, name, force=False):
def jsonrpc_resolve_name(self, name, force=False):
""" """
Resolve stream info from a LBRY name Resolve stream info from a LBRY name
@ -1629,14 +1628,12 @@ class Daemon(AuthJSONRPCServer):
try: try:
name = parse_lbry_uri(name).name name = parse_lbry_uri(name).name
metadata = yield self.wallet_manager.resolve(name, check_cache=not force) metadata = await self.wallet_manager.resolve(name, check_cache=not force)
if name in metadata: if name in metadata:
metadata = metadata[name] metadata = metadata[name]
return metadata
except UnknownNameError: except UnknownNameError:
log.info('Name %s is not known', name) log.info('Name %s is not known', name)
defer.returnValue(None)
else:
defer.returnValue(metadata)
@requires(WALLET_COMPONENT) @requires(WALLET_COMPONENT)
async def jsonrpc_claim_show(self, txid=None, nout=None, claim_id=None): async def jsonrpc_claim_show(self, txid=None, nout=None, claim_id=None):