Skip to content

Commit

Permalink
Fix merge bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sieniven committed Jul 26, 2023
1 parent 858c31a commit f6c3e51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/ain-evm/src/txqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
3 changes: 2 additions & 1 deletion test/functional/feature_evm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6c3e51

Please sign in to comment.