Skip to content

Commit b298695

Browse files
committed
f: htlc source thingy
1 parent 2e49bc3 commit b298695

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

lightning/src/ln/onion_utils.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,8 +2027,8 @@ impl HTLCFailReason {
20272027
// failures here, but that would be insufficient as find_route
20282028
// generally ignores its view of our own channels as we provide them via
20292029
// ChannelDetails.
2030-
if let &HTLCSource::OutboundRoute { ref path, .. } = htlc_source {
2031-
DecodedOnionFailure {
2030+
match htlc_source {
2031+
HTLCSource::OutboundRoute { ref path, .. } => DecodedOnionFailure {
20322032
network_update: None,
20332033
payment_failed_permanently: false,
20342034
short_channel_id: Some(path.hops[0].short_channel_id),
@@ -2038,9 +2038,19 @@ impl HTLCFailReason {
20382038
onion_error_code: Some(failure_reason.failure_code()),
20392039
#[cfg(any(test, feature = "_test_utils"))]
20402040
onion_error_data: Some(data.clone()),
2041-
}
2042-
} else {
2043-
unreachable!();
2041+
},
2042+
HTLCSource::TrampolineForward { ref hops, .. } => DecodedOnionFailure {
2043+
network_update: None,
2044+
payment_failed_permanently: false,
2045+
short_channel_id: hops.first().map(|h| h.short_channel_id),
2046+
failed_within_blinded_path: false,
2047+
hold_times: Vec::new(),
2048+
#[cfg(any(test, feature = "_test_utils"))]
2049+
onion_error_code: Some(failure_reason.failure_code()),
2050+
#[cfg(any(test, feature = "_test_utils"))]
2051+
onion_error_data: Some(data.clone()),
2052+
},
2053+
_ => unreachable!(),
20442054
}
20452055
},
20462056
}

0 commit comments

Comments
 (0)