@@ -3855,7 +3855,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
38553855 /// The channel value is an input as opposed to using from self, so that this can be used in case of splicing
38563856 /// to checks with new channel value (before being comitted to it).
38573857 #[cfg(splicing)]
3858- pub fn check_balance_meets_reserve_requirements (&self, balance: u64, channel_value: u64) -> Result<(), ChannelError> {
3858+ pub fn check_balance_meets_v2_reserve_requirements (&self, balance: u64, channel_value: u64) -> Result<(), ChannelError> {
38593859 if balance == 0 {
38603860 return Ok(());
38613861 }
@@ -4346,8 +4346,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
43464346 pub fn get_splice_init(&self, our_funding_contribution_satoshis: i64,
43474347 funding_feerate_per_kw: u32, locktime: u32,
43484348 ) -> msgs::SpliceInit {
4349- // Reuse the existing funding pubkey, in spite of the channel value changing
4350- // (though at this point we don't know the new value yet, due to the optional counterparty contribution)
4349+ // TODO(splicing): The exisiting pubkey is reused, but a new one should be generated. See #3542.
43514350 // Note that channel_keys_id is supposed NOT to change
43524351 let funding_pubkey = self.get_holder_pubkeys().funding_pubkey.clone();
43534352 msgs::SpliceInit {
@@ -4363,7 +4362,8 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
43634362 /// Get the splice_ack message that can be sent in response to splice initiation.
43644363 #[cfg(splicing)]
43654364 pub fn get_splice_ack(&self, our_funding_contribution_satoshis: i64) -> msgs::SpliceAck {
4366- // Reuse the existing funding pubkey, in spite of the channel value changing
4365+ // TODO(splicing): The exisiting pubkey is reused, but a new one should be generated. See #3542.
4366+ // Note that channel_keys_id is supposed NOT to change
43674367 let funding_pubkey = self.get_holder_pubkeys().funding_pubkey;
43684368 msgs::SpliceAck {
43694369 channel_id: self.channel_id,
@@ -8212,7 +8212,7 @@ impl<SP: Deref> FundedChannel<SP> where
82128212 let post_balance = PendingSplice::add_checked(self.context.value_to_self_msat, our_funding_contribution_satoshis);
82138213 // Early check for reserve requirement, assuming maximum balance of full channel value
82148214 // This will also be checked later at tx_complete
8215- let _res = self.context.check_balance_meets_reserve_requirements (post_balance, post_channel_value)?;
8215+ let _res = self.context.check_balance_meets_v2_reserve_requirements (post_balance, post_channel_value)?;
82168216
82178217 // TODO(splicing): Store msg.funding_pubkey
82188218 // TODO(splicing): Apply start of splice (splice_start)
@@ -8241,7 +8241,7 @@ impl<SP: Deref> FundedChannel<SP> where
82418241 let post_balance = PendingSplice::add_checked(self.context.value_to_self_msat, our_funding_contribution);
82428242 // Early check for reserve requirement, assuming maximum balance of full channel value
82438243 // This will also be checked later at tx_complete
8244- let _res = self.context.check_balance_meets_reserve_requirements (post_balance, post_channel_value)?;
8244+ let _res = self.context.check_balance_meets_v2_reserve_requirements (post_balance, post_channel_value)?;
82458245 Ok(())
82468246 }
82478247
0 commit comments