From 2298b37bc4f23ac6cf3e4b6482fc76f708faa084 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 7 Oct 2024 14:42:44 -0400 Subject: [PATCH] addrmeta can repair pools --- src/dexorder/pools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dexorder/pools.py b/src/dexorder/pools.py index 02a4cad..812a55c 100644 --- a/src/dexorder/pools.py +++ b/src/dexorder/pools.py @@ -29,15 +29,15 @@ async def get_pool(address: str) -> OldPoolDict: else: if result['base'] == ADDRESS_0 or result['quote'] == ADDRESS_0: log.warning(f'Repairing bad pool {address}') - result = address_metadata[address] = await load_pool(address) + result = address_metadata[address] = await load_pool(address, use_db=False) return result -async def load_pool(address: str) -> OldPoolDict: +async def load_pool(address: str, *, use_db=True) -> OldPoolDict: found = None chain_id = current_chain.get().id # todo other exchanges - if db: + if use_db and db: pool = db.session.get(Pool, (chain_id, address)) if pool is not None: return OldPoolDict(type='Pool', chain=chain_id, address=address, exchange=pool.exchange.value,