From 077dbb3138e93334699769daeddaf47e60491e02 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Thu, 6 Jun 2019 23:42:31 -0400 Subject: [PATCH] better handle claims which fail to decode --- lbrynet/wallet/database.py | 2 +- lbrynet/wallet/transaction.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lbrynet/wallet/database.py b/lbrynet/wallet/database.py index baa41abfc..ee887d53d 100644 --- a/lbrynet/wallet/database.py +++ b/lbrynet/wallet/database.py @@ -59,7 +59,7 @@ class WalletDatabase(BaseDatabase): channel_ids = set() for txo in txos: - if txo.script.is_claim_name or txo.script.is_update_claim: + if txo.is_claim and txo.can_decode_claim: if txo.claim.is_signed: channel_ids.add(txo.claim.signing_channel_id) if txo.claim.is_channel and my_account is not None: diff --git a/lbrynet/wallet/transaction.py b/lbrynet/wallet/transaction.py index b1430bbe3..5d7c9e8f2 100644 --- a/lbrynet/wallet/transaction.py +++ b/lbrynet/wallet/transaction.py @@ -87,6 +87,13 @@ class Output(BaseOutput): return self.script.values['claim'] raise ValueError('Only claim name and claim update have the claim payload.') + @property + def can_decode_claim(self): + try: + return self.claim + except: + return False + @property def permanent_url(self) -> str: if self.script.is_claim_involved: