Skip to content

Commit 3f8b6ac

Browse files
committed
Remove option from remove_transactions
1 parent 396701e commit 3f8b6ac

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

crates/services/txpool_v2/src/pool.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ where
354354

355355
/// Remove transaction but keep its dependents.
356356
/// The dependents become executables.
357-
pub fn remove_transactions(&mut self, tx_ids: Vec<TxId>) -> Vec<Option<ArcPoolTx>> {
357+
pub fn remove_transactions(&mut self, tx_ids: Vec<TxId>) -> Vec<ArcPoolTx> {
358358
let mut removed_transactions = Vec::with_capacity(tx_ids.len());
359359
for tx_id in tx_ids {
360360
if let Some(storage_id) = self.tx_id_to_storage_id.remove(&tx_id) {
@@ -384,9 +384,7 @@ where
384384
.new_executable_transaction(dependent, storage_data);
385385
}
386386
self.update_components_and_caches_on_removal(iter::once(&transaction));
387-
removed_transactions.push(Some(transaction.transaction));
388-
} else {
389-
removed_transactions.push(None);
387+
removed_transactions.push(transaction.transaction);
390388
}
391389
}
392390

crates/services/txpool_v2/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ where
329329
};
330330
if !removed_transactions.is_empty() {
331331
let mut height_expiration_txs = self.pruner.height_expiration_txs.write();
332-
for tx in removed_transactions.into_iter().flatten() {
332+
for tx in removed_transactions.into_iter() {
333333
let expiration = tx.expiration();
334334
if expiration < u32::MAX.into() {
335335
if let Some(expired_txs) = height_expiration_txs.get_mut(&expiration)

0 commit comments

Comments
 (0)