Skip to content

Commit 4b22708

Browse files
f probe success if payment_failed_permanently
1 parent 351419c commit 4b22708

File tree

1 file changed

+4
-5
lines changed
  • lightning-background-processor/src

1 file changed

+4
-5
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,13 @@ fn update_scorer<'a, S: 'static + Deref<Target = SC> + Send + Sync, SC: 'a + Wri
226226
) {
227227
let mut score = scorer.lock();
228228
match event {
229-
Event::PaymentPathFailed { ref path, short_channel_id, .. } => {
229+
Event::PaymentPathFailed { ref path, short_channel_id, payment_failed_permanently, .. } => {
230230
let path = path.iter().collect::<Vec<_>>();
231231
if let Some(scid) = short_channel_id {
232232
score.payment_path_failed(&path, *scid);
233-
} else {
234-
// `short_channel_id` will be None when the destination explicitly failed it back. We treat
235-
// this as a successful probe because the payment made it all the way to the destination
236-
// with sufficient liquidity.
233+
} else if *payment_failed_permanently {
234+
// Reached if the destination explicitly failed it back. We treat this as a successful probe
235+
// because the payment made it all the way to the destination with sufficient liquidity.
237236
score.probe_successful(&path);
238237
}
239238
},

0 commit comments

Comments
 (0)