From fcec70d1e37354697aadcf47ff86395f5e7d788e Mon Sep 17 00:00:00 2001 From: Yeastplume Date: Mon, 17 Dec 2018 10:40:48 +0000 Subject: [PATCH] Fix for #2169 (#2170) * return all matching tx entries from retrieve_txs * rustfmt --- wallet/src/libwallet/internal/updater.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) 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::>() };