This commit is contained in:
parent
2038877e4e
commit
b069e3d824
1 changed files with 7 additions and 6 deletions
13
hub/db/db.py
13
hub/db/db.py
|
@ -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))
|
||||||
|
|
Loading…
Reference in a new issue