Skip to content

Commit c749c47

Browse files
authored
Fix maturation loop (#3480)
1 parent 744a3d6 commit c749c47

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/wallet.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -565,19 +565,19 @@ impl Wallet {
565565

566566
if let Some(transaction) = transaction {
567567
if u32::try_from(transaction.info.confirmations).unwrap()
568-
< Runestone::COMMIT_INTERVAL.into()
568+
>= Runestone::COMMIT_INTERVAL.into()
569569
{
570-
continue;
571-
}
572-
}
573-
574-
let tx_out = self
575-
.bitcoin_client()
576-
.get_tx_out(&commit.txid(), 0, Some(true))?;
570+
let tx_out = self
571+
.bitcoin_client()
572+
.get_tx_out(&commit.txid(), 0, Some(true))?;
577573

578-
if let Some(tx_out) = tx_out {
579-
if tx_out.confirmations >= Runestone::COMMIT_INTERVAL.into() {
580-
break;
574+
if let Some(tx_out) = tx_out {
575+
if tx_out.confirmations >= Runestone::COMMIT_INTERVAL.into() {
576+
break;
577+
}
578+
} else {
579+
bail!("rune commitment spent, can't send reveal tx");
580+
}
581581
}
582582
}
583583

0 commit comments

Comments
 (0)