This commit is contained in:
Jack Robison 2022-06-17 00:53:46 -04:00
parent 2038877e4e
commit b069e3d824
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -267,12 +267,13 @@ class SecondaryDB:
# fetch the full claim hashes needed from urls with partial claim ids # fetch the full claim hashes needed from urls with partial claim ids
if needed_full_claim_hashes: if needed_full_claim_hashes:
idxs = list(needed_full_claim_hashes.keys()) unique_full_claims = defaultdict(list)
position = 0 for idx, partial_claim in needed_full_claim_hashes.items():
async for _, v in self.prefix_db.txo_to_claim.multi_get_async_gen(self._executor, list(needed_full_claim_hashes.values())): unique_full_claims[partial_claim].append(idx)
idx = idxs[position]
needed[idx] = None, v.claim_hash async for partial_claim, v in self.prefix_db.txo_to_claim.multi_get_async_gen(self._executor, list(unique_full_claims.keys())):
position += 1 for idx in unique_full_claims[partial_claim]:
needed[idx] = None, v.claim_hash
# fetch the winning claim hashes for the urls using winning resolution # fetch the winning claim hashes for the urls using winning resolution
needed_winning = list(set(normalized_name for normalized_name, _ in needed if normalized_name is not None)) needed_winning = list(set(normalized_name for normalized_name, _ in needed if normalized_name is not None))