Skip to content

Commit cc83c7a

Browse files
committed
f Remove final hop validation from forwarding trampoline hops
The original version of this PR uses our final node validation to add validation for forwarding node (this is not in the specification), and has a TODO which notes that this should be replaced with a forwarding error when we add more forwarding code. This commit removes the temporary code (since we reject trampoline forwards anyway), leaving addition of forwarding validation for later work.
1 parent ed63ce6 commit cc83c7a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lightning/src/ln/onion_payment.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ pub(super) fn create_fwd_pending_htlc_info(
161161
reason: LocalHTLCFailureReason::InvalidOnionPayload,
162162
err_data: Vec::new(),
163163
}),
164-
onion_utils::Hop::TrampolineForward { ref outer_hop_data, next_trampoline_hop_data, next_trampoline_hop_hmac, new_trampoline_packet_bytes, trampoline_shared_secret, .. } => {
165-
// TODO: return reason as forward issue, not as receiving issue when forwarding is ready.
166-
check_trampoline_onion_constraints(outer_hop_data, next_trampoline_hop_data.outgoing_cltv_value, next_trampoline_hop_data.amt_to_forward)?;
164+
onion_utils::Hop::TrampolineForward { next_trampoline_hop_data, next_trampoline_hop_hmac, new_trampoline_packet_bytes, trampoline_shared_secret, .. } => {
167165
(
168166
RoutingInfo::Trampoline {
169167
next_trampoline: next_trampoline_hop_data.next_trampoline,
@@ -178,7 +176,7 @@ pub(super) fn create_fwd_pending_htlc_info(
178176
None
179177
)
180178
},
181-
onion_utils::Hop::TrampolineBlindedForward { ref outer_hop_data, next_trampoline_hop_data, next_trampoline_hop_hmac, new_trampoline_packet_bytes, trampoline_shared_secret, .. } => {
179+
onion_utils::Hop::TrampolineBlindedForward { outer_hop_data, next_trampoline_hop_data, next_trampoline_hop_hmac, new_trampoline_packet_bytes, trampoline_shared_secret, .. } => {
182180
let (amt_to_forward, outgoing_cltv_value) = check_blinded_forward(
183181
msg.amount_msat, msg.cltv_expiry, &next_trampoline_hop_data.payment_relay, &next_trampoline_hop_data.payment_constraints, &next_trampoline_hop_data.features
184182
).map_err(|()| {
@@ -190,13 +188,6 @@ pub(super) fn create_fwd_pending_htlc_info(
190188
err_data: vec![0; 32],
191189
}
192190
})?;
193-
check_trampoline_onion_constraints(outer_hop_data, outgoing_cltv_value, amt_to_forward).map_err(|e| {
194-
InboundHTLCErr {
195-
reason: LocalHTLCFailureReason::InvalidOnionBlinding,
196-
err_data: vec![0; 32],
197-
msg: e.msg,
198-
}
199-
})?;
200191
(
201192
RoutingInfo::Trampoline {
202193
next_trampoline: next_trampoline_hop_data.next_trampoline,

0 commit comments

Comments
 (0)