From b875386845a8f1b01434357088ddf7cb9dbe7bf9 Mon Sep 17 00:00:00 2001 From: lash Date: Sun, 10 Apr 2022 16:22:25 +0000 Subject: [PATCH] Avoid duplicate txs, start store before sync --- chaind/eth/runnable/syncer.py | 1 + chaind/eth/runnable/tasker.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/chaind/eth/runnable/syncer.py b/chaind/eth/runnable/syncer.py index 81507bf..550d2f1 100644 --- a/chaind/eth/runnable/syncer.py +++ b/chaind/eth/runnable/syncer.py @@ -105,6 +105,7 @@ def main(): fltr = StateFilter(queue_adapter) sync_store = SyncFsStore(config.get('SESSION_RUNTIME_DIR'), session_id=config.get('SESSION_ID')) sync_store.register(fltr) + sync_store.start() chain_interface = EthChainInterface() drv = ChainInterfaceDriver(sync_store, chain_interface, offset=session_block_offset, target=block_limit) diff --git a/chaind/eth/runnable/tasker.py b/chaind/eth/runnable/tasker.py index 3c52401..f40a5f4 100644 --- a/chaind/eth/runnable/tasker.py +++ b/chaind/eth/runnable/tasker.py @@ -116,7 +116,9 @@ def main(): try: tx_hash = queue_adapter.put(r.hex()) - except Exception as e: + except DuplicateTxError as e: + logg.error('tx already exists as {}'.format(e)) + except ValueError as e: logg.error('adapter rejected input {}: "{}"'.format(r.hex(), e)) continue