Skip to content

Commit 6e6e4c2

Browse files
committed
Add funding redeem script to `SplicePending' event
1 parent 734bc6a commit 6e6e4c2

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

lightning/src/events/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,8 @@ pub enum Event {
15361536
/// The features that this channel will operate with. Currently, these will be the same
15371537
/// features that the channel was opened with, but in the future splices may change them.
15381538
channel_type: ChannelTypeFeatures,
1539+
/// The witness script that is used to lock the channel's funding output to commitment transactions.
1540+
new_funding_redeem_script: ScriptBuf,
15391541
},
15401542
/// Used to indicate that a splice for the given `channel_id` has failed.
15411543
///
@@ -2313,6 +2315,7 @@ impl Writeable for Event {
23132315
ref counterparty_node_id,
23142316
ref new_funding_txo,
23152317
ref channel_type,
2318+
ref new_funding_redeem_script,
23162319
} => {
23172320
50u8.write(writer)?;
23182321
write_tlv_fields!(writer, {
@@ -2321,6 +2324,7 @@ impl Writeable for Event {
23212324
(5, user_channel_id, required),
23222325
(7, counterparty_node_id, required),
23232326
(9, new_funding_txo, required),
2327+
(11, new_funding_redeem_script, required),
23242328
});
23252329
},
23262330
&Event::SpliceFailed {
@@ -2936,6 +2940,7 @@ impl MaybeReadable for Event {
29362940
(5, user_channel_id, required),
29372941
(7, counterparty_node_id, required),
29382942
(9, new_funding_txo, required),
2943+
(11, new_funding_redeem_script, required),
29392944
});
29402945

29412946
Ok(Some(Event::SplicePending {
@@ -2944,6 +2949,7 @@ impl MaybeReadable for Event {
29442949
counterparty_node_id: counterparty_node_id.0.unwrap(),
29452950
new_funding_txo: new_funding_txo.0.unwrap(),
29462951
channel_type: channel_type.0.unwrap(),
2952+
new_funding_redeem_script: new_funding_redeem_script.0.unwrap(),
29472953
}))
29482954
};
29492955
f()

lightning/src/ln/channel.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6853,6 +6853,9 @@ pub struct SpliceFundingNegotiated {
68536853

68546854
/// The features that this channel will operate with.
68556855
pub channel_type: ChannelTypeFeatures,
6856+
6857+
/// The redeem script of the funding output.
6858+
pub funding_redeem_script: ScriptBuf,
68566859
}
68576860

68586861
/// Information about a splice funding negotiation that has failed.
@@ -8936,12 +8939,14 @@ where
89368939
let funding_txo =
89378940
funding.get_funding_txo().expect("funding outpoint should be set");
89388941
let channel_type = funding.get_channel_type().clone();
8942+
let funding_redeem_script = funding.get_funding_redeemscript();
89398943

89408944
pending_splice.negotiated_candidates.push(funding);
89418945

89428946
let splice_negotiated = SpliceFundingNegotiated {
89438947
funding_txo: funding_txo.into_bitcoin_outpoint(),
89448948
channel_type,
8949+
funding_redeem_script,
89458950
};
89468951

89478952
let splice_locked = pending_splice.check_get_splice_locked(

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6459,6 +6459,8 @@ where
64596459
user_channel_id: chan.context.get_user_id(),
64606460
new_funding_txo: splice_negotiated.funding_txo,
64616461
channel_type: splice_negotiated.channel_type,
6462+
new_funding_redeem_script: splice_negotiated
6463+
.funding_redeem_script,
64626464
},
64636465
None,
64646466
));
@@ -9615,6 +9617,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96159617
user_channel_id: channel.context.get_user_id(),
96169618
new_funding_txo: splice_negotiated.funding_txo,
96179619
channel_type: splice_negotiated.channel_type,
9620+
new_funding_redeem_script: splice_negotiated.funding_redeem_script,
96189621
},
96199622
None,
96209623
));
@@ -10644,6 +10647,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1064410647
user_channel_id: chan.context.get_user_id(),
1064510648
new_funding_txo: splice_negotiated.funding_txo,
1064610649
channel_type: splice_negotiated.channel_type,
10650+
new_funding_redeem_script: splice_negotiated.funding_redeem_script,
1064710651
},
1064810652
None,
1064910653
));

0 commit comments

Comments
 (0)