Skip to content

Commit e6f7455

Browse files
committed
Simplify if
1 parent 6e1ab15 commit e6f7455

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lightning-invoice/src/payment.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,8 @@ where
595595
// hop and then drop the event instead of handing it up to the user's event
596596
// handler.
597597
if self.payer.payment_is_probe(*payment_hash, *payment_id) {
598-
if *rejected_by_dest {
599-
self.scorer.lock().payment_path_failed(&path, u64::max_value());
600-
} else {
601-
self.scorer.lock().payment_path_failed(&path, *short_channel_id);
602-
}
598+
let scid = if *rejected_by_dest { u64::max_value() } else { *short_channel_id };
599+
self.scorer.lock().payment_path_failed(&path, scid);
603600
return;
604601
}
605602
}

0 commit comments

Comments
 (0)