From fa49b4038956360abbcff75d68dc4c53e3ab5710 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 19 Apr 2018 12:31:36 -0400 Subject: [PATCH] fix claim_show --- CHANGELOG.md | 1 + lbrynet/core/Wallet.py | 6 ++---- lbrynet/daemon/Daemon.py | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd95f777a..a261709e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ at anytime. * issue where an `AuthAPIClient` (used by `lbrynet-cli`) would fail to update its session secret and keep making new auth sessions, with every other request failing * `use_auth_http` in a config file being overridden by the default command line argument to `lbrynet-daemon`, now the command line value will only override the config file value if it is provided * `lbrynet-cli` not automatically switching to the authenticated client if the server is detected to be using authentication. This resulted in `lbrynet-cli` failing to run when `lbrynet-daemon` was run with the `--http-auth` flag + * fixed error when using `claim_show` with `txid` and `nout` arguments ### Deprecated * diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index 4d6a7ea3f..64ab317de 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -446,14 +446,12 @@ class Wallet(object): defer.returnValue(claims) @defer.inlineCallbacks - def get_claim_by_outpoint(self, claim_outpoint, check_expire=True): - txid, nout = claim_outpoint.split(":") - nout = int(nout) + def get_claim_by_outpoint(self, txid, nout, check_expire=True): claim = yield self._get_claim_by_outpoint(txid, nout) try: result = self._handle_claim_result(claim) yield self.save_claim(result) - except (UnknownOutpoint) as err: + except UnknownOutpoint as err: result = {'error': err.message} defer.returnValue(result) diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 05001cde6..82fb5c7a0 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -1488,8 +1488,7 @@ class Daemon(AuthJSONRPCServer): if claim_id is not None and txid is None and nout is None: claim_results = yield self.session.wallet.get_claim_by_claim_id(claim_id) elif txid is not None and nout is not None and claim_id is None: - outpoint = ClaimOutpoint(txid, nout) - claim_results = yield self.session.wallet.get_claim_by_outpoint(outpoint) + claim_results = yield self.session.wallet.get_claim_by_outpoint(txid, int(nout)) else: raise Exception("Must specify either txid/nout, or claim_id") response = yield self._render_response(claim_results)