catch claim signature error

This commit is contained in:
Jack Robison 2018-10-25 18:54:07 -04:00
parent 416472c5d8
commit e1dcdcf4db
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -2,6 +2,7 @@ from decimal import Decimal
from binascii import hexlify from binascii import hexlify
from datetime import datetime from datetime import datetime
from json import JSONEncoder from json import JSONEncoder
from ecdsa import BadSignatureError
from lbrynet.wallet.transaction import Transaction, Output from lbrynet.wallet.transaction import Transaction, Output
from lbrynet.wallet.dewies import dewies_to_lbc from lbrynet.wallet.dewies import dewies_to_lbc
from lbrynet.wallet.ledger import MainNetLedger from lbrynet.wallet.ledger import MainNetLedger
@ -68,9 +69,12 @@ class JSONResponseEncoder(JSONEncoder):
output['valid_signature'] = None output['valid_signature'] = None
if txo.channel is not None: if txo.channel is not None:
output['channel_name'] = txo.channel.claim_name output['channel_name'] = txo.channel.claim_name
output['valid_signature'] = claim.validate_signature( try:
txo.get_address(self.ledger), txo.channel.claim output['valid_signature'] = claim.validate_signature(
) txo.get_address(self.ledger), txo.channel.claim
)
except BadSignatureError:
output['valid_signature'] = False
if txo.script.is_claim_name: if txo.script.is_claim_name:
output['type'] = 'claim' output['type'] = 'claim'