Skip to content

Commit 05448f5

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 559f8db commit 05448f5

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
@@ -8743,7 +8743,27 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
87438743
attribution_data,
87448744
send_timestamp,
87458745
),
8746-
HTLCSource::TrampolineForward { .. } => todo!(),
8746+
// TODO: This branch should be tested when Trampoline Forwarding is implemented.
8747+
HTLCSource::TrampolineForward { previous_hop_data, .. } => {
8748+
for current_previous_hop_data in previous_hop_data {
8749+
self.claim_funds_from_previous_hop_internal(
8750+
payment_preimage,
8751+
forwarded_htlc_value_msat,
8752+
skimmed_fee_msat,
8753+
from_onchain,
8754+
startup_replay,
8755+
next_channel_counterparty_node_id,
8756+
next_channel_outpoint,
8757+
next_channel_id,
8758+
next_user_channel_id,
8759+
current_previous_hop_data,
8760+
// Clone the attribution data because it is going to be updated using the
8761+
// current_previous_hop_data respectively.
8762+
attribution_data.clone(),
8763+
send_timestamp,
8764+
);
8765+
}
8766+
},
87478767
}
87488768
}
87498769

0 commit comments

Comments
 (0)