Skip to content

Commit 38a928f

Browse files
committed
f - Add clarifying comments
1 parent ad0edff commit 38a928f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/onion_utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
355355
chacha.process(&packet_decrypted, &mut decryption_tmp[..]);
356356
packet_decrypted = decryption_tmp;
357357

358+
// The failing hop is either the channel leading to the recipient or the channel
359+
// identified by the current hop.
358360
is_from_final_node = route_hop_idx + 1 == path.len();
359361
let failing_route_hop = if is_from_final_node { route_hop } else { &path[route_hop_idx + 1] };
360362

@@ -430,6 +432,8 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
430432
is_permanent: true,
431433
});
432434
} else {
435+
// Make sure the ChannelUpdate contains the expected
436+
// short channel id.
433437
if failing_route_hop.short_channel_id == chan_update.contents.short_channel_id {
434438
short_channel_id = Some(failing_route_hop.short_channel_id);
435439
}

0 commit comments

Comments
 (0)