add handling for invalid claims in calculate_reposts

This commit is contained in:
Lex Berezhny 2019-11-18 16:23:03 -05:00
parent fd632392d4
commit 36bd7816fe

View file

@ -386,11 +386,15 @@ class SQLDB:
'support', {'txo_hash__in': [sqlite3.Binary(txo_hash) for txo_hash in txo_hashes]}
))
def calculate_reposts(self, claims: List[Output]):
def calculate_reposts(self, txos: List[Output]):
targets = set()
for claim in claims:
if claim.claim.is_repost:
targets.add((claim.claim.repost.reference.claim_hash,))
for txo in txos:
try:
claim = txo.claim
except:
continue
if claim.is_repost:
targets.add((claim.repost.reference.claim_hash,))
if targets:
self.db.executemany(
"""