From a634c49e1c169257ff9ddf98b18fe45312156cc6 Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Tue, 18 Apr 2017 12:46:41 -0400 Subject: [PATCH 1/3] stream_cost_estimate throws exception when value is not decodeable --- lbrynet/lbrynet_daemon/Daemon.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index f3c3c8e76..69a06c9e8 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -889,12 +889,13 @@ class Daemon(AuthJSONRPCServer): """ try: claim_response = yield self.session.wallet.resolve_uri(uri) + #TODO: fix me, this is a hack except Exception: claim_response = None result = None if claim_response and 'claim' in claim_response: - if 'value' in claim_response['claim']: + if 'value' in claim_response['claim'] and claim_response['claim']['value'] is not None: claim_value = ClaimDict.load_dict(claim_response['claim']['value']) cost = yield self._get_est_cost_from_metadata(claim_value, uri) result = round(cost, 5) From bbbdf5486e4a3ddeabe3805b617c9c7f47cf9e33 Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Tue, 18 Apr 2017 12:50:07 -0400 Subject: [PATCH 2/3] clarify docstring for stream_cost_estimate --- lbrynet/lbrynet_daemon/Daemon.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 69a06c9e8..e3c7a2f74 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -1720,7 +1720,8 @@ class Daemon(AuthJSONRPCServer): 'size' (optional): (int) stream size, in bytes. if provided an sd blob won't be downloaded. Returns: - (float) Estimated cost in lbry credits + (float) Estimated cost in lbry credits, returns None if uri is not + resolveable """ cost = yield self.get_est_cost(uri, size) defer.returnValue(cost) From c4b69055c79c010a73fbf9775560a4faad2b5c5a Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Tue, 18 Apr 2017 12:49:56 -0400 Subject: [PATCH 3/3] add changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 540413102..77b93e713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ at anytime. * ### Fixed - * + * fix stream_cost_estimate throwing exception on non decodeable claims * *