diff --git a/lbrynet/extras/daemon/json_response_encoder.py b/lbrynet/extras/daemon/json_response_encoder.py index 9b0096f12..f42357358 100644 --- a/lbrynet/extras/daemon/json_response_encoder.py +++ b/lbrynet/extras/daemon/json_response_encoder.py @@ -172,7 +172,7 @@ class JSONResponseEncoder(JSONEncoder): 'normalized': txo.normalized_name, 'claim_id': txo.claim_id, 'permanent_url': txo.permanent_url, - 'meta': txo.meta + 'meta': self.encode_claim_meta(txo.meta) }) if txo.script.is_claim_name or txo.script.is_update_claim: try: @@ -186,7 +186,7 @@ class JSONResponseEncoder(JSONEncoder): 'normalized': txo.channel.normalized_name, 'claim_id': txo.channel.claim_id, 'value': txo.channel.claim, - 'meta': txo.channel.meta + 'meta': self.encode_claim_meta(txo.channel.meta) } if check_signature and txo.claim.is_signed: output['is_channel_signature_valid'] = False @@ -196,6 +196,13 @@ class JSONResponseEncoder(JSONEncoder): pass return output + def encode_claim_meta(self, meta): + if isinstance(meta.get('effective_amount'), int): + meta['effective_amount'] = dewies_to_lbc(meta['effective_amount']) + if isinstance(meta.get('trending_amount'), int): + meta['trending_amount'] = dewies_to_lbc(meta['trending_amount']) + return meta + def encode_input(self, txi): return self.encode_output(txi.txo_ref.txo, False) if txi.txo_ref.txo is not None else { 'txid': txi.txo_ref.tx_ref.id, diff --git a/lbrynet/wallet/ledger.py b/lbrynet/wallet/ledger.py index eb68c4f43..6c67ae148 100644 --- a/lbrynet/wallet/ledger.py +++ b/lbrynet/wallet/ledger.py @@ -64,7 +64,7 @@ class MainNetLedger(BaseLedger): assert len(urls) == len(txos), "Mismatch between urls requested for resolve and responses received." result = {} for url, txo in zip(urls, txos): - if txo and URL.parse(url).has_channel: + if txo and URL.parse(url).has_stream_in_channel: if not txo.channel or not txo.is_signed_by(txo.channel, self): txo = None if txo: