@@ -235,6 +235,7 @@ pub enum PendingHTLCRouting {
235
235
blinded: Option<BlindedForward>,
236
236
/// The absolute CLTV of the inbound HTLC
237
237
incoming_cltv_expiry: Option<u32>,
238
+ hold_htlc: bool,
238
239
},
239
240
/// An HTLC which should be forwarded on to another Trampoline node.
240
241
TrampolineForward {
@@ -4876,14 +4877,15 @@ where
4876
4877
}
4877
4878
let funding_txo = chan.funding.get_funding_txo().unwrap();
4878
4879
let logger = WithChannelContext::from(&self.logger, &chan.context, Some(*payment_hash));
4880
+ let hold_htlc = true; // TODO: Take from invoice?
4879
4881
let send_res = chan.send_htlc_and_commit(htlc_msat, payment_hash.clone(),
4880
4882
htlc_cltv, HTLCSource::OutboundRoute {
4881
4883
path: path.clone(),
4882
4884
session_priv: session_priv.clone(),
4883
4885
first_hop_htlc_msat: htlc_msat,
4884
4886
payment_id,
4885
4887
bolt12_invoice: bolt12_invoice.cloned(),
4886
- }, onion_packet, None, &self.fee_estimator, &&logger);
4888
+ }, onion_packet, None, hold_htlc, &self.fee_estimator, &&logger);
4887
4889
match break_channel_entry!(self, peer_state, send_res, chan_entry) {
4888
4890
Some(monitor_update) => {
4889
4891
match handle_new_monitor_update!(self, funding_txo, monitor_update, peer_state_lock, peer_state, per_peer_state, chan) {
@@ -6024,6 +6026,7 @@ where
6024
6026
PendingHTLCRouting::Forward { onion_packet, blinded, incoming_cltv_expiry, .. } => {
6025
6027
PendingHTLCRouting::Forward {
6026
6028
onion_packet, blinded, incoming_cltv_expiry, short_channel_id: next_hop_scid,
6029
+ hold_htlc: false, // Do not hold intercepted HTLCs.
6027
6030
}
6028
6031
},
6029
6032
_ => unreachable!() // Only `PendingHTLCRouting::Forward`s are intercepted
@@ -6222,6 +6225,9 @@ where
6222
6225
incoming_accept_underpaying_htlcs,
6223
6226
next_packet_details_opt.map(|d| d.next_packet_pubkey),
6224
6227
) {
6228
+ // if let PendingHTLCRouting::Forward { hold_htlc, .. } = info.routing {
6229
+ // debug_assert!(hold_htlc, "Expected HTLC to be held");
6230
+ // }
6225
6231
Ok(info) => htlc_forwards.push((info, update_add_htlc.htlc_id)),
6226
6232
Err(inbound_err) => {
6227
6233
let failure_type =
@@ -14558,6 +14564,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
14558
14564
(1, blinded, option),
14559
14565
(2, short_channel_id, required),
14560
14566
(3, incoming_cltv_expiry, option),
14567
+ (4, hold_htlc, (default_value, false))
14561
14568
},
14562
14569
(1, Receive) => {
14563
14570
(0, payment_data, required),
0 commit comments