From 9e8a4d61e1a4f28d6bed2b6d43f8450d1b4d70f5 Mon Sep 17 00:00:00 2001 From: Andrey Falaleev Date: Wed, 27 Nov 2024 17:29:16 +0000 Subject: [PATCH] mempool: fix clearing completed tx cache --- proxy/mempool/transaction_dict.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/mempool/transaction_dict.py b/proxy/mempool/transaction_dict.py index 75cda389..3517440f 100644 --- a/proxy/mempool/transaction_dict.py +++ b/proxy/mempool/transaction_dict.py @@ -57,7 +57,8 @@ def done_tx(self, neon_tx_hash: EthTxHash) -> None: self._tx_queue.append(item) def pop_tx(self, neon_tx_hash: EthTxHash) -> None: - self._tx_hash_dict.pop(neon_tx_hash, None) + if tx := self._tx_hash_dict.pop(neon_tx_hash, None): + self._sender_nonce_dict.pop(SenderNonce.from_raw(tx), None) def get_tx_by_hash(self, neon_tx_hash: EthTxHash) -> NeonTxModel | None: if tx := self._tx_hash_dict.get(neon_tx_hash, None):