@@ -171,6 +171,7 @@ pub enum PendingHTLCRouting {
171
171
incoming_cltv_expiry: Option<u32>,
172
172
},
173
173
/// An HTLC which should be forwarded on to another Trampoline node.
174
+ #[cfg(trampoline)]
174
175
TrampolineForward {
175
176
/// The onion shared secret we build with the sender (or the preceding Trampoline node) used
176
177
/// to decrypt the onion.
@@ -288,6 +289,7 @@ impl PendingHTLCRouting {
288
289
fn blinded_failure(&self) -> Option<BlindedFailure> {
289
290
match self {
290
291
Self::Forward { blinded: Some(BlindedForward { failure, .. }), .. } => Some(*failure),
292
+ #[cfg(trampoline)]
291
293
Self::TrampolineForward { blinded: Some(BlindedForward { failure, .. }), .. } => Some(*failure),
292
294
Self::Receive { requires_blinded_error: true, .. } => Some(BlindedFailure::FromBlindedNode),
293
295
Self::ReceiveKeysend { requires_blinded_error: true, .. } => Some(BlindedFailure::FromBlindedNode),
@@ -298,6 +300,7 @@ impl PendingHTLCRouting {
298
300
fn incoming_cltv_expiry(&self) -> Option<u32> {
299
301
match self {
300
302
Self::Forward { incoming_cltv_expiry, .. } => *incoming_cltv_expiry,
303
+ #[cfg(trampoline)]
301
304
Self::TrampolineForward { incoming_cltv_expiry, .. } => Some(*incoming_cltv_expiry),
302
305
Self::Receive { incoming_cltv_expiry, .. } => Some(*incoming_cltv_expiry),
303
306
Self::ReceiveKeysend { incoming_cltv_expiry, .. } => Some(*incoming_cltv_expiry),
@@ -8929,6 +8932,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8929
8932
for (forward_info, prev_htlc_id) in pending_forwards.drain(..) {
8930
8933
let scid = match forward_info.routing {
8931
8934
PendingHTLCRouting::Forward { short_channel_id, .. } => short_channel_id,
8935
+ #[cfg(trampoline)]
8932
8936
PendingHTLCRouting::TrampolineForward { .. } => 0,
8933
8937
PendingHTLCRouting::Receive { .. } => 0,
8934
8938
PendingHTLCRouting::ReceiveKeysend { .. } => 0,
@@ -12470,6 +12474,36 @@ impl_writeable_tlv_based!(BlindedForward, {
12470
12474
(3, next_blinding_override, option),
12471
12475
});
12472
12476
12477
+ #[cfg(not(trampoline))]
12478
+ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
12479
+ (0, Forward) => {
12480
+ (0, onion_packet, required),
12481
+ (1, blinded, option),
12482
+ (2, short_channel_id, required),
12483
+ (3, incoming_cltv_expiry, option),
12484
+ },
12485
+ (1, Receive) => {
12486
+ (0, payment_data, required),
12487
+ (1, phantom_shared_secret, option),
12488
+ (2, incoming_cltv_expiry, required),
12489
+ (3, payment_metadata, option),
12490
+ (5, custom_tlvs, optional_vec),
12491
+ (7, requires_blinded_error, (default_value, false)),
12492
+ (9, payment_context, option),
12493
+ },
12494
+ (2, ReceiveKeysend) => {
12495
+ (0, payment_preimage, required),
12496
+ (1, requires_blinded_error, (default_value, false)),
12497
+ (2, incoming_cltv_expiry, required),
12498
+ (3, payment_metadata, option),
12499
+ (4, payment_data, option), // Added in 0.0.116
12500
+ (5, custom_tlvs, optional_vec),
12501
+ (7, has_recipient_created_payment_secret, (default_value, false)),
12502
+ (9, payment_context, option),
12503
+ (11, invoice_request, option),
12504
+ },
12505
+ );
12506
+ #[cfg(trampoline)]
12473
12507
impl_writeable_tlv_based_enum!(PendingHTLCRouting,
12474
12508
(0, Forward) => {
12475
12509
(0, onion_packet, required),
0 commit comments