diff --git a/wallet/src/libwallet/internal/updater.rs b/wallet/src/libwallet/internal/updater.rs index 6c425e152e..26469ab6b3 100644 --- a/wallet/src/libwallet/internal/updater.rs +++ b/wallet/src/libwallet/internal/updater.rs @@ -94,19 +94,12 @@ where { // just read the wallet here, no need for a write lock let mut txs = if let Some(id) = tx_id { - let tx = wallet.tx_log_iter().find(|t| t.id == id); - if let Some(t) = tx { - vec![t] - } else { - vec![] - } + wallet.tx_log_iter().filter(|t| t.id == id).collect() } else if tx_slate_id.is_some() { - let tx = wallet.tx_log_iter().find(|t| t.tx_slate_id == tx_slate_id); - if let Some(t) = tx { - vec![t] - } else { - vec![] - } + wallet + .tx_log_iter() + .filter(|t| t.tx_slate_id == tx_slate_id) + .collect() } else { wallet.tx_log_iter().collect::>() };