Skip to content

Commit 3f9ca25

Browse files
committed
ln: handle trampoline claims on restart
This commit uses the existing outbound payment claims replay logic to restore trampoline claims. If any single previous hop in a htlc source with multiple previous hops requires claim, we represent this with a single outbound claimed htlc because we assume that *all* of the incoming htlcs are represented in the source, and will be appropriately claimed (rather than submitting multiple claims, which will end up being duplicates of each other). This is the case for trampoline payments, where the htlc_source stores all previous hops.
1 parent c010889 commit 3f9ca25

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19514,6 +19514,9 @@ impl<
1951419514
let payment_preimage = preimage_opt?;
1951519515
let prev_htlcs = match &htlc_source {
1951619516
HTLCSource::PreviousHopData(prev_hop) => vec![prev_hop],
19517+
HTLCSource::TrampolineForward { previous_hop_data, .. } => {
19518+
previous_hop_data.iter().collect()
19519+
},
1951719520
// If it was an outbound payment, we've handled it above - if a preimage
1951819521
// came in and we persisted the `ChannelManager` we either handled it
1951919522
// and are good to go or the channel force-closed - we don't have to

0 commit comments

Comments
 (0)