Avoid duplicate txs, start store before sync

This commit is contained in:
lash 2022-04-10 16:22:25 +00:00
parent 8167d84419
commit b875386845
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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