Skip to content

Commit

Permalink
Simplify if
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Jun 25, 2022
1 parent 6e1ab15 commit e6f7455
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lightning-invoice/src/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,8 @@ where
// hop and then drop the event instead of handing it up to the user's event
// handler.
if self.payer.payment_is_probe(*payment_hash, *payment_id) {
if *rejected_by_dest {
self.scorer.lock().payment_path_failed(&path, u64::max_value());
} else {
self.scorer.lock().payment_path_failed(&path, *short_channel_id);
}
let scid = if *rejected_by_dest { u64::max_value() } else { *short_channel_id };
self.scorer.lock().payment_path_failed(&path, scid);
return;
}
}
Expand Down

0 comments on commit e6f7455

Please sign in to comment.