@@ -1186,12 +1186,6 @@ impl UnfundedChannelContext {
11861186#[derive(Clone)]
11871187pub(crate) struct PendingSpliceInfoPre {
11881188 pub our_funding_contribution: i64,
1189- // TODO(splicing): Enable below fields
1190- // pub funding_feerate_perkw: u32,
1191- // pub locktime: u32,
1192- // /// The funding inputs we will be contributing to the splice.
1193- // /// TODO(splice): will be changed to TransactionU16LenLimited
1194- // pub our_funding_inputs: Vec<(TxIn, Transaction)>,
11951189}
11961190
11971191#[cfg(splicing)]
@@ -3653,23 +3647,24 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
36533647 (context.holder_selected_channel_reserve_satoshis, context.counterparty_selected_channel_reserve_satoshis)
36543648 }
36553649
3656- /// Check that a proposed channel value meets the channel reserve requirements or violates them (below reserve)
3650+ /// Check that a balance value meets the channel reserve requirements or violates them (below reserve).
3651+ /// The channel value is an input, so that this can be used for checks with new planned channel value.
36573652 #[cfg(any(dual_funding, splicing))]
3658- pub fn check_channel_value_meets_reserve_requirements (&self, proposed_channel_value : u64) -> Result<(), ChannelError> {
3653+ pub fn check_balance_meets_reserve_requirements (&self, channel_value: u64, balance : u64) -> Result<(), ChannelError> {
36593654 let holder_selected_channel_reserve_satoshis = get_v2_channel_reserve_satoshis(
3660- proposed_channel_value , self.holder_dust_limit_satoshis);
3661- if proposed_channel_value < holder_selected_channel_reserve_satoshis {
3655+ channel_value , self.holder_dust_limit_satoshis);
3656+ if balance < holder_selected_channel_reserve_satoshis {
36623657 return Err(ChannelError::Warn(format!(
3663- "Proposed channel value below reserve mandated by holder, {} vs {}",
3664- proposed_channel_value , holder_selected_channel_reserve_satoshis,
3658+ "Balance below reserve mandated by holder, {} vs {}",
3659+ balance , holder_selected_channel_reserve_satoshis,
36653660 )));
36663661 }
36673662 let counterparty_selected_channel_reserve_satoshis = get_v2_channel_reserve_satoshis(
3668- proposed_channel_value , self.counterparty_dust_limit_satoshis);
3669- if proposed_channel_value < counterparty_selected_channel_reserve_satoshis {
3663+ channel_value , self.counterparty_dust_limit_satoshis);
3664+ if balance < counterparty_selected_channel_reserve_satoshis {
36703665 return Err(ChannelError::Warn(format!(
3671- "Proposed channel value below reserve mandated by counterparty, {} vs {}",
3672- proposed_channel_value , counterparty_selected_channel_reserve_satoshis,
3666+ "Balance below reserve mandated by counterparty, {} vs {}",
3667+ balance , counterparty_selected_channel_reserve_satoshis,
36733668 )));
36743669 }
36753670 Ok(())
@@ -7922,14 +7917,10 @@ impl<SP: Deref> Channel<SP> where
79227917 where ES::Target: EntropySource, L::Target: Logger
79237918 {
79247919 if !self.context.is_outbound() {
7925- // TODO(splicing): Enable starting in the line below
7926- // Apply start of splice change in the state
7927- // self.context.splice_start(false, logger);
7920+ // TODO(splicing): Apply start of splice (splice_start)
79287921
79297922 let splice_ack_msg = self.context.get_splice_ack(our_funding_contribution_satoshis)?;
79307923 // TODO(splicing): start interactive funding negotiation
7931- // let _msg = post_chan.begin_interactive_funding_tx_construction(signer_provider, entropy_source, holder_node_id)
7932- // .map_err(|err| ChannelError::Warn(format!("Failed to start interactive transaction construction, {:?}", err)))?;
79337924 Ok(splice_ack_msg)
79347925 } else {
79357926 Err(ChannelError::Warn("Internal consistency error: splice_init on inbound channel".into()))
0 commit comments