Skip to content

Commit b86e48c

Browse files
f only set scid field if not InvalidRoute err
1 parent 8ca2b54 commit b86e48c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ impl OutboundPayments {
709709
let mut events = pending_events.lock().unwrap();
710710
debug_assert_eq!(paths.len(), path_results.len());
711711
for (path, path_res) in paths.into_iter().zip(path_results) {
712-
if path_res.is_err() {
712+
if let Err(e) = path_res {
713713
let scid = path[0].short_channel_id;
714714
events.push(events::Event::PaymentPathFailed {
715715
payment_id: Some(payment_id),
@@ -718,7 +718,7 @@ impl OutboundPayments {
718718
network_update: None,
719719
all_paths_failed: false,
720720
path,
721-
short_channel_id: Some(scid),
721+
short_channel_id: if let APIError::InvalidRoute { .. } = e { None } else { Some(scid) },
722722
retry: None,
723723
#[cfg(test)]
724724
error_code: None,

0 commit comments

Comments
 (0)