From 16fde66c6af92b4a093f73181375646d3228f59f Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 17 Nov 2020 15:24:26 +0100 Subject: [PATCH] use flatten instead of unwrap_or --- src/blockchain/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blockchain/utils.rs b/src/blockchain/utils.rs index 79c9c9f0..dd5de887 100644 --- a/src/blockchain/utils.rs +++ b/src/blockchain/utils.rs @@ -159,7 +159,7 @@ pub trait ElectrumLikeSync { // save any tx details not in db but in history_txs_id or with different height/timestamp for txid in history_txs_id.iter() { - let height = *txid_height.get(txid).unwrap_or(&None); + let height = txid_height.get(txid).cloned().flatten(); let timestamp = *new_timestamps.get(txid).unwrap_or(&0u64); if let Some(tx_details) = txs_details_in_db.get(txid) { // check if height matches, otherwise updates it