@@ -1186,12 +1186,6 @@ impl UnfundedChannelContext {
1186
1186
#[derive(Clone)]
1187
1187
pub(crate) struct PendingSpliceInfoPre {
1188
1188
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)>,
1195
1189
}
1196
1190
1197
1191
#[cfg(splicing)]
@@ -3653,23 +3647,24 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
3653
3647
(context.holder_selected_channel_reserve_satoshis, context.counterparty_selected_channel_reserve_satoshis)
3654
3648
}
3655
3649
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.
3657
3652
#[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> {
3659
3654
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 {
3662
3657
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,
3665
3660
)));
3666
3661
}
3667
3662
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 {
3670
3665
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,
3673
3668
)));
3674
3669
}
3675
3670
Ok(())
@@ -7922,14 +7917,10 @@ impl<SP: Deref> Channel<SP> where
7922
7917
where ES::Target: EntropySource, L::Target: Logger
7923
7918
{
7924
7919
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)
7928
7921
7929
7922
let splice_ack_msg = self.context.get_splice_ack(our_funding_contribution_satoshis)?;
7930
7923
// 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)))?;
7933
7924
Ok(splice_ack_msg)
7934
7925
} else {
7935
7926
Err(ChannelError::Warn("Internal consistency error: splice_init on inbound channel".into()))
0 commit comments