@@ -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 {
@@ -4879,14 +4880,15 @@ where
4879
4880
}
4880
4881
let funding_txo = chan.funding.get_funding_txo().unwrap();
4881
4882
let logger = WithChannelContext::from(&self.logger, &chan.context, Some(*payment_hash));
4883
+ let hold_htlc = true; // TODO: Take from invoice?
4882
4884
let send_res = chan.send_htlc_and_commit(htlc_msat, payment_hash.clone(),
4883
4885
htlc_cltv, HTLCSource::OutboundRoute {
4884
4886
path: path.clone(),
4885
4887
session_priv: session_priv.clone(),
4886
4888
first_hop_htlc_msat: htlc_msat,
4887
4889
payment_id,
4888
4890
bolt12_invoice: bolt12_invoice.cloned(),
4889
- }, onion_packet, None, &self.fee_estimator, &&logger);
4891
+ }, onion_packet, None, hold_htlc, &self.fee_estimator, &&logger);
4890
4892
match break_channel_entry!(self, peer_state, send_res, chan_entry) {
4891
4893
Some(monitor_update) => {
4892
4894
match handle_new_monitor_update!(self, funding_txo, monitor_update, peer_state_lock, peer_state, per_peer_state, chan) {
@@ -6027,6 +6029,7 @@ where
6027
6029
PendingHTLCRouting::Forward { onion_packet, blinded, incoming_cltv_expiry, .. } => {
6028
6030
PendingHTLCRouting::Forward {
6029
6031
onion_packet, blinded, incoming_cltv_expiry, short_channel_id: next_hop_scid,
6032
+ hold_htlc: false, // Do not hold intercepted HTLCs.
6030
6033
}
6031
6034
},
6032
6035
_ => unreachable!() // Only `PendingHTLCRouting::Forward`s are intercepted
@@ -6225,6 +6228,9 @@ where
6225
6228
incoming_accept_underpaying_htlcs,
6226
6229
next_packet_details_opt.map(|d| d.next_packet_pubkey),
6227
6230
) {
6231
+ // if let PendingHTLCRouting::Forward { hold_htlc, .. } = info.routing {
6232
+ // debug_assert!(hold_htlc, "Expected HTLC to be held");
6233
+ // }
6228
6234
Ok(info) => htlc_forwards.push((info, update_add_htlc.htlc_id)),
6229
6235
Err(inbound_err) => {
6230
6236
let failure_type =
@@ -14387,6 +14393,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
14387
14393
(1, blinded, option),
14388
14394
(2, short_channel_id, required),
14389
14395
(3, incoming_cltv_expiry, option),
14396
+ (4, hold_htlc, (default_value, false))
14390
14397
},
14391
14398
(1, Receive) => {
14392
14399
(0, payment_data, required),
0 commit comments