From c1fbb02bfe89d012f5c320a092fa50a620cf8184 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sun, 24 Mar 2019 17:44:46 -0400 Subject: [PATCH] dont validate inputs in json_response_encoder --- lbrynet/extras/daemon/json_response_encoder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lbrynet/extras/daemon/json_response_encoder.py b/lbrynet/extras/daemon/json_response_encoder.py index 535001921..68f4c7053 100644 --- a/lbrynet/extras/daemon/json_response_encoder.py +++ b/lbrynet/extras/daemon/json_response_encoder.py @@ -49,7 +49,7 @@ class JSONResponseEncoder(JSONEncoder): 'hex': hexlify(tx.raw).decode(), } - def encode_output(self, txo): + def encode_output(self, txo, check_signature=True): tx_height = txo.tx_ref.height best_height = self.ledger.headers.height output = { @@ -77,7 +77,7 @@ class JSONResponseEncoder(JSONEncoder): output['value'] = claim if claim.is_signed: output['valid_signature'] = None - if txo.channel is not None: + if check_signature and txo.channel is not None: output['channel_name'] = txo.channel.claim_name try: output['valid_signature'] = txo.is_signed_by(txo.channel, self.ledger) @@ -102,7 +102,7 @@ class JSONResponseEncoder(JSONEncoder): return output def encode_input(self, txi): - return self.encode_output(txi.txo_ref.txo) if txi.txo_ref.txo is not None else { + 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, 'nout': txi.txo_ref.position }