Skip to content

Commit f05016e

Browse files
committed
Comments (review)
1 parent dcf7ef8 commit f05016e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4097,7 +4097,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
40974097
/// The channel value is an input as opposed to using from self, so that this can be used in case of splicing
40984098
/// to checks with new channel value (before being comitted to it).
40994099
#[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> {
41014101
if balance == 0 {
41024102
return Ok(());
41034103
}
@@ -4596,8 +4596,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
45964596
pub fn get_splice_init(&self, our_funding_contribution_satoshis: i64,
45974597
funding_feerate_per_kw: u32, locktime: u32,
45984598
) -> 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.
46014600
// Note that channel_keys_id is supposed NOT to change
46024601
let funding_pubkey = self.get_holder_pubkeys().funding_pubkey.clone();
46034602
msgs::SpliceInit {
@@ -4613,7 +4612,8 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
46134612
/// Get the splice_ack message that can be sent in response to splice initiation.
46144613
#[cfg(splicing)]
46154614
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
46174617
let funding_pubkey = self.get_holder_pubkeys().funding_pubkey;
46184618
msgs::SpliceAck {
46194619
channel_id: self.channel_id,
@@ -8463,7 +8463,7 @@ impl<SP: Deref> FundedChannel<SP> where
84638463
let post_balance = PendingSplice::add_checked(self.funding.value_to_self_msat, our_funding_contribution_satoshis);
84648464
// Early check for reserve requirement, assuming maximum balance of full channel value
84658465
// 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)?;
84678467

84688468
// TODO(splicing): Store msg.funding_pubkey
84698469
// TODO(splicing): Apply start of splice (splice_start)
@@ -8492,7 +8492,7 @@ impl<SP: Deref> FundedChannel<SP> where
84928492
let post_balance = PendingSplice::add_checked(self.funding.value_to_self_msat, our_funding_contribution);
84938493
// Early check for reserve requirement, assuming maximum balance of full channel value
84948494
// 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)?;
84968496
Ok(())
84978497
}
84988498

0 commit comments

Comments
 (0)