Skip to content

Commit aa3387e

Browse files
f comments
1 parent 4fbad83 commit aa3387e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lightning/src/ln/onion_utils.rs

+2
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,13 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
484484
// The failing hop includes either the inbound channel to the recipient or the outbound channel
485485
// from the current hop (i.e., the next hop's inbound channel).
486486
let num_blinded_hops = path.blinded_tail.as_ref().map_or(0, |bt| bt.hops.len());
487+
// For 1-hop blinded paths, the final `path.hops` entry is the recipient.
487488
is_from_final_node = route_hop_idx + 1 == path.hops.len() && num_blinded_hops <= 1;
488489
let failing_route_hop = if is_from_final_node { route_hop } else {
489490
match path.hops.get(route_hop_idx + 1) {
490491
Some(hop) => hop,
491492
None => {
493+
// The failing hop is within a multi-hop blinded path.
492494
error_code_ret = Some(BADONION | PERM | 24); // invalid_onion_blinding
493495
error_packet_ret = Some(vec![0; 32]);
494496
res = Some(FailureLearnings {

0 commit comments

Comments
 (0)