@@ -2253,14 +2253,10 @@ impl FundingScope {
2253
2253
debug_assert!(post_value_to_self_msat_signed >= 0);
2254
2254
let post_value_to_self_msat = post_value_to_self_msat_signed as u64;
2255
2255
2256
+ // Rotate the pubkeys using the prev_funding_txid as a tweak
2256
2257
let prev_funding_txid = prev_funding.get_funding_txid();
2257
- // Update the splicing 'tweak', this will rotate the keys in the signer
2258
- let holder_pubkeys = match &context.holder_signer {
2259
- ChannelSignerType::Ecdsa(ecdsa) => ecdsa.pubkeys(prev_funding_txid, &context.secp_ctx),
2260
- // TODO (taproot|arik)
2261
- #[cfg(taproot)]
2262
- _ => todo!(),
2263
- };
2258
+ let holder_pubkeys = context.holder_pubkeys(prev_funding_txid);
2259
+
2264
2260
let channel_parameters = &prev_funding.channel_transaction_parameters;
2265
2261
let mut post_channel_transaction_parameters = ChannelTransactionParameters {
2266
2262
holder_pubkeys,
@@ -2280,7 +2276,7 @@ impl FundingScope {
2280
2276
.pubkeys
2281
2277
.funding_pubkey = counterparty_funding_pubkey;
2282
2278
2283
- // New reserve values are based on the new channel value, and v2-specific
2279
+ // New reserve values are based on the new channel value and are v2-specific
2284
2280
let counterparty_selected_channel_reserve_satoshis = Some(get_v2_channel_reserve_satoshis(
2285
2281
post_channel_value,
2286
2282
context.counterparty_dust_limit_satoshis,
@@ -3759,6 +3755,16 @@ where
3759
3755
return &mut self.holder_signer;
3760
3756
}
3761
3757
3758
+ /// Returns holder pubkeys to use for the channel.
3759
+ fn holder_pubkeys(&self, prev_funding_txid: Option<Txid>) -> ChannelPublicKeys {
3760
+ match &self.holder_signer {
3761
+ ChannelSignerType::Ecdsa(ecdsa) => ecdsa.pubkeys(prev_funding_txid, &self.secp_ctx),
3762
+ // TODO (taproot|arik)
3763
+ #[cfg(taproot)]
3764
+ _ => todo!(),
3765
+ }
3766
+ }
3767
+
3762
3768
/// Only allowed immediately after deserialization if get_outbound_scid_alias returns 0,
3763
3769
/// indicating we were written by LDK prior to 0.0.106 which did not set outbound SCID aliases
3764
3770
/// or prior to any channel actions during `Channel` initialization.
@@ -10405,9 +10411,10 @@ where
10405
10411
fn get_splice_init(
10406
10412
&self, our_funding_contribution_satoshis: i64, funding_feerate_per_kw: u32, locktime: u32,
10407
10413
) -> msgs::SpliceInit {
10408
- // TODO(splicing): The exisiting pubkey is reused, but a new one should be generated. See #3542.
10409
- // Note that channel_keys_id is supposed NOT to change
10410
- let funding_pubkey = self.funding.get_holder_pubkeys().funding_pubkey.clone();
10414
+ // Rotate the pubkeys using the prev_funding_txid as a tweak
10415
+ let prev_funding_txid = self.funding.get_funding_txid();
10416
+ let funding_pubkey = self.context.holder_pubkeys(prev_funding_txid).funding_pubkey;
10417
+
10411
10418
msgs::SpliceInit {
10412
10419
channel_id: self.context.channel_id,
10413
10420
funding_contribution_satoshis: our_funding_contribution_satoshis,
0 commit comments