Skip to content

Commit c418034

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.
1 parent 05f2848 commit c418034

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
@@ -4118,6 +4118,14 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
41184118
self.funding.prev_holder_commitment_tx.clone(),
41194119
);
41204120

4121+
// It's possible that no commitment updates happened during the lifecycle of the pending
4122+
// splice's `FundingScope` that was promoted. If so, our `prev_holder_htlc_data` is
4123+
// now irrelevant, since there's no valid previous commitment that exists for the current
4124+
// funding transaction that could be broadcast.
4125+
if self.funding.prev_holder_commitment_tx.is_none() {
4126+
self.prev_holder_htlc_data.take();
4127+
}
4128+
41214129
let no_further_updates_allowed = self.no_further_updates_allowed();
41224130

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

0 commit comments

Comments
 (0)