Skip to content

Commit 4fab2db

Browse files
wpaulinoTheBlueMatt
authored andcommitted
Remove previous holder HTLC data on splice locked when necessary
If while a splice is pending, the channel happens to not have any commitment updates, but did prior to the splice being negotiated, it's possible that we end up with bogus holder HTLC data for the previous commitment. After the splice becomes locked, we've successfully transitioned to the new funding transaction, but that funding transaction never had a commitment transaction negotiated for the previous state. Backport of c418034
1 parent 7634697 commit 4fab2db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4175,6 +4175,14 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
41754175
self.funding.prev_holder_commitment_tx.clone(),
41764176
);
41774177

4178+
// It's possible that no commitment updates happened during the lifecycle of the pending
4179+
// splice's `FundingScope` that was promoted. If so, our `prev_holder_htlc_data` is
4180+
// now irrelevant, since there's no valid previous commitment that exists for the current
4181+
// funding transaction that could be broadcast.
4182+
if self.funding.prev_holder_commitment_tx.is_none() {
4183+
self.prev_holder_htlc_data.take();
4184+
}
4185+
41784186
let no_further_updates_allowed = self.no_further_updates_allowed();
41794187

41804188
// The swap above places the previous `FundingScope` into `pending_funding`.

0 commit comments

Comments
 (0)