From 3534e35b8721c5026b27d4d3c07b87dc6e4fa3dd Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 12 Oct 2022 17:17:45 +0200 Subject: [PATCH] bitcoin: remove erroneous block height check --- src/bitcoin/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bitcoin/mod.rs b/src/bitcoin/mod.rs index 0c0f9c1c..d3b101d7 100644 --- a/src/bitcoin/mod.rs +++ b/src/bitcoin/mod.rs @@ -171,10 +171,10 @@ impl BitcoinInterface for d::BitcoinD { let mut txs_to_cache: Vec<(bitcoin::Txid, Option)> = Vec::new(); if let Some(tx) = tx { - if let Some(block_height) = tx.block_height { - if block_height > 1 { - spent.push((*op, *txid, tx.block_time.expect("Spend is confirmed"))) - } + if let Some(block_time) = tx.block_time { + // TODO: make both block time and height under the same Option. + assert!(tx.block_height.is_some()); + spent.push((*op, *txid, block_time)) } else if !tx.conflicting_txs.is_empty() { for txid in tx.conflicting_txs.clone() { let tx: Option<&d::GetTxRes> = match cache.get(&txid) {