Skip to content

Commit 35a0eb5

Browse files
committed
f: fix failing test from 3daab67
1 parent b6febbc commit 35a0eb5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lightning/src/ln/blinded_payment_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2535,6 +2535,6 @@ fn test_trampoline_forward_rejection() {
25352535
// Expect UnknownNextPeer error while we are unable to route forwarding Trampoline payments.
25362536
let payment_failed_conditions = PaymentFailedConditions::new()
25372537
.expected_htlc_error_data(LocalHTLCFailureReason::UnknownNextPeer, &[0; 0]);
2538-
expect_payment_failed_conditions(&nodes[0], payment_hash, false, payment_failed_conditions);
2538+
expect_payment_failed_conditions(&nodes[0], payment_hash, true, payment_failed_conditions);
25392539
}
25402540
}

lightning/src/ln/onion_utils.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,10 +1373,17 @@ where
13731373
short_channel_id = route_hop.short_channel_id()
13741374
}
13751375

1376+
// If next hop is from a trampoline we are already inside the trampoline
1377+
// route. If we found a permanent failure inside the trampoline route, we
1378+
// fail the payment permanently.
1379+
let is_next_hop_from_trampoline =
1380+
matches!(next_hop, Some((_, (Some(ErrorHop::TrampolineHop(..)), _))));
1381+
13761382
res = Some(FailureLearnings {
13771383
network_update,
13781384
short_channel_id,
1379-
payment_failed_permanently: error_code.is_permanent() && is_from_final_non_blinded_node,
1385+
payment_failed_permanently: error_code.is_permanent()
1386+
&& (is_from_final_non_blinded_node || is_next_hop_from_trampoline),
13801387
failed_within_blinded_path: false,
13811388
});
13821389

0 commit comments

Comments
 (0)