Skip to content

Commit 96aa4ed

Browse files
Score PaymentPathFailed w/o scid as ProbeSuccess
Prior to this commit, we wouldn't score PaymentPathFailed events when the destination explicitly failed the payment back (which causes the blamed scid to be None). Instead, we should treat this as a ProbeSuccess because the payment reached the destination.
1 parent 49b8c15 commit 96aa4ed

File tree

1 file changed

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

1 file changed

+6
-2
lines changed

lightning-background-processor/src/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,14 @@ fn update_scorer<'a, S: 'static + Deref<Target = SC> + Send + Sync, SC: 'a + Wri
225225
scorer: &'a S, event: &Event
226226
) {
227227
match event {
228-
Event::PaymentPathFailed { ref path, short_channel_id: Some(scid), .. } => {
228+
Event::PaymentPathFailed { ref path, short_channel_id, .. } => {
229229
let path = path.iter().collect::<Vec<_>>();
230230
let mut score = scorer.lock();
231-
score.payment_path_failed(&path, *scid);
231+
if let Some(scid) = short_channel_id {
232+
score.payment_path_failed(&path, *scid);
233+
} else {
234+
score.probe_successful(&path);
235+
}
232236
},
233237
Event::PaymentPathSuccessful { path, .. } => {
234238
let path = path.iter().collect::<Vec<_>>();

0 commit comments

Comments
 (0)