add handling for invalid claims in calculate_reposts
This commit is contained in:
parent
fd632392d4
commit
36bd7816fe
1 changed files with 8 additions and 4 deletions
|
@ -386,11 +386,15 @@ class SQLDB:
|
||||||
'support', {'txo_hash__in': [sqlite3.Binary(txo_hash) for txo_hash in txo_hashes]}
|
'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()
|
targets = set()
|
||||||
for claim in claims:
|
for txo in txos:
|
||||||
if claim.claim.is_repost:
|
try:
|
||||||
targets.add((claim.claim.repost.reference.claim_hash,))
|
claim = txo.claim
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
if claim.is_repost:
|
||||||
|
targets.add((claim.repost.reference.claim_hash,))
|
||||||
if targets:
|
if targets:
|
||||||
self.db.executemany(
|
self.db.executemany(
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue