Skip to content

Commit 808402d

Browse files
committed
f Drop unnecessary as_ref() calls when accessing last_spending_tx
1 parent 4686459 commit 808402d

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
@@ -571,7 +571,7 @@ where
571571
if cur_height >= confirmation_height + ANTI_REORG_DELAY - 1 {
572572
log_debug!(self.logger,
573573
"Pruning swept output as sufficiently confirmed via spend in transaction {:?}. Pruned descriptor: {:?}",
574-
o.status.latest_spending_tx().as_ref().map(|t| t.txid()), o.descriptor
574+
o.status.latest_spending_tx().map(|t| t.txid()), o.descriptor
575575
);
576576
return false;
577577
}
@@ -681,7 +681,7 @@ where
681681
let unconf_height = state_lock
682682
.outputs
683683
.iter()
684-
.find(|o| o.status.latest_spending_tx().as_ref().map(|tx| tx.txid()) == Some(*txid))
684+
.find(|o| o.status.latest_spending_tx().map(|tx| tx.txid()) == Some(*txid))
685685
.and_then(|o| o.status.confirmation_height());
686686

687687
// Unconfirm all >= this height.
@@ -722,7 +722,7 @@ where
722722
.filter_map(|o| {
723723
if let Some(confirmation_hash) = o.status.confirmation_hash() {
724724
if let Some(confirmation_height) = o.status.confirmation_height() {
725-
if let Some(latest_spending_tx) = o.status.latest_spending_tx().as_ref() {
725+
if let Some(latest_spending_tx) = o.status.latest_spending_tx() {
726726
return Some((
727727
latest_spending_tx.txid(),
728728
confirmation_height,

0 commit comments

Comments
 (0)