From c34b15079412126b16dd13024f2bf7e799cbd180 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 29 Nov 2018 20:56:55 -0300 Subject: [PATCH] check and log claim id validity during migration --- lbrynet/extras/wallet/account.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lbrynet/extras/wallet/account.py b/lbrynet/extras/wallet/account.py index 94bbbe1e2..8a4cc9b57 100644 --- a/lbrynet/extras/wallet/account.py +++ b/lbrynet/extras/wallet/account.py @@ -1,6 +1,7 @@ import json import logging +from lbrynet.schema.validator import validate_claim_id from torba.client.baseaccount import BaseAccount from torba.client.basetransaction import TXORef @@ -46,6 +47,15 @@ class Account(BaseAccount): for maybe_claim_id in list(self.certificates): results['total'] += 1 if ':' not in maybe_claim_id: + try: + validate_claim_id(maybe_claim_id) + except Exception as e: + log.warning( + "Failed to migrate claim '%s': %s", + maybe_claim_id, str(e) + ) + results['migrate-failed'] += 1 + continue claims = await self.ledger.network.get_claims_by_ids(maybe_claim_id) if maybe_claim_id not in claims: log.warning(