Skip to content

Commit 6cdbb5e

Browse files
committed
f Match on PendingThresholdConfirmations
1 parent a545d30 commit 6cdbb5e

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

lightning/src/util/sweep.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -701,20 +701,14 @@ where
701701
state_lock
702702
.outputs
703703
.iter()
704-
.filter_map(|o| {
705-
if let Some(confirmation_hash) = o.status.confirmation_hash() {
706-
if let Some(confirmation_height) = o.status.confirmation_height() {
707-
if let Some(latest_spending_tx) = o.status.latest_spending_tx() {
708-
return Some((
709-
latest_spending_tx.txid(),
710-
confirmation_height,
711-
Some(confirmation_hash),
712-
));
713-
}
714-
}
715-
}
716-
717-
None
704+
.filter_map(|o| match o.status {
705+
OutputSpendStatus::PendingThresholdConfirmations {
706+
ref latest_spending_tx,
707+
confirmation_height,
708+
confirmation_hash,
709+
..
710+
} => Some((latest_spending_tx.txid(), confirmation_height, Some(confirmation_hash))),
711+
_ => None,
718712
})
719713
.collect::<Vec<_>>()
720714
}

0 commit comments

Comments
 (0)