Skip to content

Commit 24e9a51

Browse files
Score PaymentPathFailed with payment_failed_permanently as ProbeSuccess
Prior to this commit, we wouldn't score PaymentPathFailed events when the destination explicitly failed the payment back when the blamed scid is None. Instead, we should treat this as a ProbeSuccess because the payment reached the destination.
1 parent eb06199 commit 24e9a51

File tree

1 file changed

+6
-0
lines changed
  • lightning-background-processor/src

1 file changed

+6
-0
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ fn update_scorer<'a, S: 'static + Deref<Target = SC> + Send + Sync, SC: 'a + Wri
230230
let path = path.iter().collect::<Vec<_>>();
231231
score.payment_path_failed(&path, *scid);
232232
},
233+
Event::PaymentPathFailed { ref path, payment_failed_permanently: true, .. } => {
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.
236+
let path = path.iter().collect::<Vec<_>>();
237+
score.probe_successful(&path);
238+
},
233239
Event::PaymentPathSuccessful { path, .. } => {
234240
let path = path.iter().collect::<Vec<_>>();
235241
score.payment_path_successful(&path);

0 commit comments

Comments
 (0)