From 10d206cf461689f4b6ab0a25f3217be698111f48 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Tue, 9 Apr 2024 00:07:34 +0000 Subject: [PATCH] fix: deduplicate internal transfers in db --- scripts/exporters/treasury_transactions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/exporters/treasury_transactions.py b/scripts/exporters/treasury_transactions.py index 011896a6a..8c5f48fd8 100644 --- a/scripts/exporters/treasury_transactions.py +++ b/scripts/exporters/treasury_transactions.py @@ -56,9 +56,10 @@ async def load_new_txs(start_block: Block, end_block: Block) -> int: futs = [ asyncio.create_task(insert_treasury_tx(entry)) async for entry in treasury.ledger._get_and_yield(start_block, end_block) - if entry.value + if not isinstance(entry, _Done) and entry.value ] - return sum(await tqdm_asyncio.gather(*futs, desc="Insert Txs to Postgres")) + to_sort = sum(await tqdm_asyncio.gather(*futs, desc="Insert Txs to Postgres")) + return to_sort # NOTE: Things get sketchy when we bump these higher