better handle claims which fail to decode

This commit is contained in:
Lex Berezhny 2019-06-06 23:42:31 -04:00
parent 3b8fd65fa9
commit 077dbb3138
2 changed files with 8 additions and 1 deletions

View file

@ -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:

View file

@ -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: