Skip to content

Commit 12328f1

Browse files
committed
f Drop unnecessary as_ref() calls when accessing last_spending_tx
1 parent 68f715c commit 12328f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/util/sweep.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ where
573573
if cur_height >= confirmation_height + ANTI_REORG_DELAY - 1 {
574574
log_debug!(self.logger,
575575
"Pruning swept output as sufficiently confirmed via spend in transaction {:?}. Pruned descriptor: {:?}",
576-
o.status.latest_spending_tx().as_ref().map(|t| t.txid()), o.descriptor
576+
o.status.latest_spending_tx().map(|t| t.txid()), o.descriptor
577577
);
578578
return false;
579579
}
@@ -683,7 +683,7 @@ where
683683
let unconf_height = state_lock
684684
.outputs
685685
.iter()
686-
.find(|o| o.status.latest_spending_tx().as_ref().map(|tx| tx.txid()) == Some(*txid))
686+
.find(|o| o.status.latest_spending_tx().map(|tx| tx.txid()) == Some(*txid))
687687
.and_then(|o| o.status.confirmation_height());
688688

689689
// Unconfirm all >= this height.
@@ -724,7 +724,7 @@ where
724724
.filter_map(|o| {
725725
if let Some(confirmation_hash) = o.status.confirmation_hash() {
726726
if let Some(confirmation_height) = o.status.confirmation_height() {
727-
if let Some(latest_spending_tx) = o.status.latest_spending_tx().as_ref() {
727+
if let Some(latest_spending_tx) = o.status.latest_spending_tx() {
728728
return Some((
729729
latest_spending_tx.txid(),
730730
confirmation_height,

0 commit comments

Comments
 (0)