Skip to content

Commit 3c9037d

Browse files
f don't set scid as previously failed on invalid route
1 parent b86e48c commit 3c9037d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,15 +710,19 @@ impl OutboundPayments {
710710
debug_assert_eq!(paths.len(), path_results.len());
711711
for (path, path_res) in paths.into_iter().zip(path_results) {
712712
if let Err(e) = path_res {
713-
let scid = path[0].short_channel_id;
713+
let failed_scid = if let APIError::InvalidRoute { .. } = e {
714+
None
715+
} else {
716+
Some(path[0].short_channel_id)
717+
};
714718
events.push(events::Event::PaymentPathFailed {
715719
payment_id: Some(payment_id),
716720
payment_hash,
717721
payment_failed_permanently: false,
718722
network_update: None,
719723
all_paths_failed: false,
720724
path,
721-
short_channel_id: if let APIError::InvalidRoute { .. } = e { None } else { Some(scid) },
725+
short_channel_id: failed_scid,
722726
retry: None,
723727
#[cfg(test)]
724728
error_code: None,

0 commit comments

Comments
 (0)