diff --git a/src/dexorder/pools.py b/src/dexorder/pools.py index 81ec780..3847b03 100644 --- a/src/dexorder/pools.py +++ b/src/dexorder/pools.py @@ -41,6 +41,12 @@ class Pools: except ContractLogicError: log.debug(f'new Unknown pool at {address}') found = Pool(chain=chain, address=address, exchange=Exchange.Unknown, base=ADDRESS_0, quote=ADDRESS_0, fee=0) + except ValueError as v: + if v.args[0].get('code') == -32000: + log.debug(f'new Unknown pool at {address}') + found = Pool(chain=chain, address=address, exchange=Exchange.Unknown, base=ADDRESS_0, quote=ADDRESS_0, fee=0) + else: + raise db.session.add(found) Pools.instances[key] = found return None if found.exchange == Exchange.Unknown else found diff --git a/src/dexorder/runner.py b/src/dexorder/runner.py index 6166c51..6176185 100644 --- a/src/dexorder/runner.py +++ b/src/dexorder/runner.py @@ -323,7 +323,13 @@ class BlockStateRunner: if not self.state_initialized: await self.do_state_init_cbs() # logevent callbacks - for future, callback, event, filter_args in batches: + while True: + try: + # we remove entries as we process them, so the exception handler doesn't re-await the callbacks + batch = batches.pop(0) + except IndexError: + break + future, callback, event, filter_args = batch if future is None: await maywait(callback()) # non-log callback else: