From c749c47325c4d86f4351d523b40791aa05e0fb24 Mon Sep 17 00:00:00 2001 From: raph Date: Tue, 9 Apr 2024 00:18:09 +0200 Subject: [PATCH] Fix maturation loop (#3480) --- src/wallet.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wallet.rs b/src/wallet.rs index b1ff75f0b3..a524e9f763 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -565,19 +565,19 @@ impl Wallet { if let Some(transaction) = transaction { if u32::try_from(transaction.info.confirmations).unwrap() - < Runestone::COMMIT_INTERVAL.into() + >= Runestone::COMMIT_INTERVAL.into() { - continue; - } - } - - let tx_out = self - .bitcoin_client() - .get_tx_out(&commit.txid(), 0, Some(true))?; + let tx_out = self + .bitcoin_client() + .get_tx_out(&commit.txid(), 0, Some(true))?; - if let Some(tx_out) = tx_out { - if tx_out.confirmations >= Runestone::COMMIT_INTERVAL.into() { - break; + if let Some(tx_out) = tx_out { + if tx_out.confirmations >= Runestone::COMMIT_INTERVAL.into() { + break; + } + } else { + bail!("rune commitment spent, can't send reveal tx"); + } } }