@@ -4097,7 +4097,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
4097
4097
/// The channel value is an input as opposed to using from self, so that this can be used in case of splicing
4098
4098
/// to checks with new channel value (before being comitted to it).
4099
4099
#[cfg(splicing)]
4100
- pub fn check_balance_meets_reserve_requirements (&self, balance: u64, channel_value: u64) -> Result<(), ChannelError> {
4100
+ pub fn check_balance_meets_v2_reserve_requirements (&self, balance: u64, channel_value: u64) -> Result<(), ChannelError> {
4101
4101
if balance == 0 {
4102
4102
return Ok(());
4103
4103
}
@@ -4596,8 +4596,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
4596
4596
pub fn get_splice_init(&self, our_funding_contribution_satoshis: i64,
4597
4597
funding_feerate_per_kw: u32, locktime: u32,
4598
4598
) -> msgs::SpliceInit {
4599
- // Reuse the existing funding pubkey, in spite of the channel value changing
4600
- // (though at this point we don't know the new value yet, due to the optional counterparty contribution)
4599
+ // TODO(splicing): The exisiting pubkey is reused, but a new one should be generated. See #3542.
4601
4600
// Note that channel_keys_id is supposed NOT to change
4602
4601
let funding_pubkey = self.get_holder_pubkeys().funding_pubkey.clone();
4603
4602
msgs::SpliceInit {
@@ -4613,7 +4612,8 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
4613
4612
/// Get the splice_ack message that can be sent in response to splice initiation.
4614
4613
#[cfg(splicing)]
4615
4614
pub fn get_splice_ack(&self, our_funding_contribution_satoshis: i64) -> msgs::SpliceAck {
4616
- // Reuse the existing funding pubkey, in spite of the channel value changing
4615
+ // TODO(splicing): The exisiting pubkey is reused, but a new one should be generated. See #3542.
4616
+ // Note that channel_keys_id is supposed NOT to change
4617
4617
let funding_pubkey = self.get_holder_pubkeys().funding_pubkey;
4618
4618
msgs::SpliceAck {
4619
4619
channel_id: self.channel_id,
@@ -8463,7 +8463,7 @@ impl<SP: Deref> FundedChannel<SP> where
8463
8463
let post_balance = PendingSplice::add_checked(self.funding.value_to_self_msat, our_funding_contribution_satoshis);
8464
8464
// Early check for reserve requirement, assuming maximum balance of full channel value
8465
8465
// This will also be checked later at tx_complete
8466
- let _res = self.context.check_balance_meets_reserve_requirements (post_balance, post_channel_value)?;
8466
+ let _res = self.context.check_balance_meets_v2_reserve_requirements (post_balance, post_channel_value)?;
8467
8467
8468
8468
// TODO(splicing): Store msg.funding_pubkey
8469
8469
// TODO(splicing): Apply start of splice (splice_start)
@@ -8492,7 +8492,7 @@ impl<SP: Deref> FundedChannel<SP> where
8492
8492
let post_balance = PendingSplice::add_checked(self.funding.value_to_self_msat, our_funding_contribution);
8493
8493
// Early check for reserve requirement, assuming maximum balance of full channel value
8494
8494
// This will also be checked later at tx_complete
8495
- let _res = self.context.check_balance_meets_reserve_requirements (post_balance, post_channel_value)?;
8495
+ let _res = self.context.check_balance_meets_v2_reserve_requirements (post_balance, post_channel_value)?;
8496
8496
Ok(())
8497
8497
}
8498
8498
0 commit comments