diff --git a/src/database/memory.rs b/src/database/memory.rs index cc56c94d..7d806eb4 100644 --- a/src/database/memory.rs +++ b/src/database/memory.rs @@ -512,10 +512,13 @@ macro_rules! populate_test_db { }; let txid = tx.txid(); - let confirmation_time = tx_meta.min_confirmations.map(|conf| $crate::BlockTime { - height: current_height.unwrap().checked_sub(conf as u32).unwrap(), - timestamp: 0, - }); + let confirmation_time = tx_meta + .min_confirmations + .and_then(|v| if v == 0 { None } else { Some(v) }) + .map(|conf| $crate::BlockTime { + height: current_height.unwrap().checked_sub(conf as u32).unwrap() + 1, + timestamp: 0, + }); let tx_details = $crate::TransactionDetails { transaction: Some(tx.clone()), diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index 213cc60d..36cc1622 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -4723,7 +4723,7 @@ pub(crate) mod test { crate::populate_test_db!( wallet.database.borrow_mut(), - testutils! (@tx ( (@external descriptors, 0) => 25_000 ) (@confirmations 0)), + testutils! (@tx ( (@external descriptors, 0) => 25_000 ) (@confirmations 1)), Some(confirmation_time), (@coinbase true) );