diff --git a/lib/ain-evm/src/txqueue.rs b/lib/ain-evm/src/txqueue.rs index 0b0f0cd47f..e795806010 100644 --- a/lib/ain-evm/src/txqueue.rs +++ b/lib/ain-evm/src/txqueue.rs @@ -274,16 +274,16 @@ impl TransactionQueue { } pub fn remove_txs_by_sender(&self, sender: H160) { + let tx_queue = self.get_cloned_vec(); let mut data = self.data.lock().unwrap(); - let queued_txs = &self.data.lock().unwrap().transactions; - for queue_item in queued_txs { - let tx_sender = match &queue_item.queue_tx { + for item in tx_queue { + let tx_sender = match &item.queue_tx { QueueTx::SignedTx(tx) => tx.sender, QueueTx::BridgeTx(tx) => tx.sender(), }; if tx_sender == sender { - data.total_fees -= queue_item.tx_fee; - data.total_gas_used -= queue_item.gas_used; + data.total_fees -= item.tx_fee; + data.total_gas_used -= item.gas_used; } } data.transactions.retain(|item| { diff --git a/test/functional/feature_evm.py b/test/functional/feature_evm.py index 3e4612b96e..8aa15ec591 100755 --- a/test/functional/feature_evm.py +++ b/test/functional/feature_evm.py @@ -245,7 +245,8 @@ def run_test(self): 'r': '0x3a0587be1a14bd5e68bc883e627f3c0999cff9458e30ea8049f17bd7369d7d9c', 's': '0x1876f296657bc56499cc6398617f97b2327fa87189c0a49fb671b4361876142a', 'type': '0x0', - 'maxFeePerGas': '0x4e3b29200'} + 'maxFeePerGas': '0x4e3b29200', + 'chainId': '0x1'} ]) # Try and send EVM TX a second time