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