Skip to content

Commit ee95116

Browse files
committed
Add trampoline routing payment claiming
Implement payment claiming for `HTLCSource::TrampolineForward` by iterating through previous hop data and claiming funds for each HTLC. Note that testing should be implemented when trampoline forwarding is completed.
1 parent b167ce5 commit ee95116

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8637,7 +8637,27 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
86378637
attribution_data,
86388638
send_timestamp,
86398639
),
8640-
HTLCSource::TrampolineForward { .. } => todo!(),
8640+
// TODO: This branch should be tested when Trampoline Forwarding is implemented.
8641+
HTLCSource::TrampolineForward { previous_hop_data, .. } => {
8642+
for current_previous_hop_data in previous_hop_data {
8643+
self.claim_funds_from_previous_hop_internal(
8644+
payment_preimage,
8645+
forwarded_htlc_value_msat,
8646+
skimmed_fee_msat,
8647+
from_onchain,
8648+
startup_replay,
8649+
next_channel_counterparty_node_id,
8650+
next_channel_outpoint,
8651+
next_channel_id,
8652+
next_user_channel_id,
8653+
current_previous_hop_data,
8654+
// Clone the attribution data because it is going to be updated using the
8655+
// current_previous_hop_data respectively.
8656+
attribution_data.clone(),
8657+
send_timestamp,
8658+
);
8659+
}
8660+
},
86418661
}
86428662
}
86438663

0 commit comments

Comments
 (0)