fix claim_show

This commit is contained in:
Victor Shyba 2018-10-17 16:25:44 -03:00 committed by Lex Berezhny
parent 8db7c15aa1
commit f049109a38

View file

@ -1639,8 +1639,7 @@ class Daemon(AuthJSONRPCServer):
defer.returnValue(metadata) defer.returnValue(metadata)
@requires(WALLET_COMPONENT) @requires(WALLET_COMPONENT)
@defer.inlineCallbacks async def jsonrpc_claim_show(self, txid=None, nout=None, claim_id=None):
def jsonrpc_claim_show(self, txid=None, nout=None, claim_id=None):
""" """
Resolve claim info from txid/nout or with claim ID Resolve claim info from txid/nout or with claim ID
@ -1676,13 +1675,12 @@ class Daemon(AuthJSONRPCServer):
""" """
if claim_id is not None and txid is None and nout is None: if claim_id is not None and txid is None and nout is None:
claim_results = yield self.wallet_manager.get_claim_by_claim_id(claim_id) claim_results = await self.wallet_manager.get_claim_by_claim_id(claim_id)
elif txid is not None and nout is not None and claim_id is None: elif txid is not None and nout is not None and claim_id is None:
claim_results = yield self.wallet_manager.get_claim_by_outpoint(txid, int(nout)) claim_results = await self.wallet_manager.get_claim_by_outpoint(txid, int(nout))
else: else:
raise Exception("Must specify either txid/nout, or claim_id") raise Exception("Must specify either txid/nout, or claim_id")
response = yield self._render_response(claim_results) return claim_results
defer.returnValue(response)
@requires(WALLET_COMPONENT) @requires(WALLET_COMPONENT)
async def jsonrpc_resolve(self, force=False, uri=None, uris=None): async def jsonrpc_resolve(self, force=False, uri=None, uris=None):