handle unicode error for unnormalized names

This commit is contained in:
Jack Robison 2021-08-15 16:24:07 -04:00
parent 3a1baf0700
commit 54903fc2ea
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -411,7 +411,10 @@ class BlockProcessor:
def _add_claim_or_update(self, height: int, txo: 'Output', tx_hash: bytes, tx_num: int, nout: int,
spent_claims: typing.Dict[bytes, typing.Tuple[int, int, str]]):
claim_name = txo.script.values['claim_name'].decode()
try:
claim_name = txo.script.values['claim_name'].decode()
except UnicodeDecodeError:
claim_name = ''.join(chr(c) for c in txo.script.values['claim_name'])
try:
normalized_name = txo.normalized_name
except UnicodeDecodeError: