@@ -4663,17 +4663,32 @@ where
4663
4663
}
4664
4664
}
4665
4665
4666
- /// Initiate a splice, to change the channel capacity of an existing funded channel.
4667
- /// After completion of splicing, the funding transaction will be replaced by a new one, spending the old funding transaction,
4668
- /// with optional extra inputs (splice-in) and/or extra outputs (splice-out or change).
4669
- /// TODO(splicing): Implementation is currently incomplete.
4666
+ /// Initiate a splice in order to add value to (splice-in) or remove value from (splice-out)
4667
+ /// the channel. This will spend the channel's funding transaction output, effectively replacing
4668
+ /// it with a new one.
4670
4669
///
4671
- /// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
4670
+ /// # Arguments
4672
4671
///
4673
- /// - `our_funding_contribution_satoshis`: the amount contributed by us to the channel. This will increase our channel balance.
4674
- /// - `our_funding_inputs`: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
4675
- /// Includes the witness weight for this input (e.g. P2WPKH_WITNESS_WEIGHT=109 for typical P2WPKH inputs).
4676
- /// - `locktime`: Optional locktime for the new funding transaction. If None, set to the current block height.
4672
+ /// Provide a `contribution` to determine if value is spliced in or out. The splice initiator is
4673
+ /// responsible for paying fees for common fields, shared inputs, and shared outputs along with
4674
+ /// any contributed inputs and outputs. Fees are determined using `funding_feerate_per_kw` and
4675
+ /// must be covered by the supplied inputs for splice-in or the channel balance for splice-out.
4676
+ ///
4677
+ /// An optional `locktime` for the funding transaction may be specified. If not given, the
4678
+ /// current best block height is used.
4679
+ ///
4680
+ /// # Events
4681
+ ///
4682
+ /// Once the funding transaction has been constructed, an [`Event::SplicePending`] will be
4683
+ /// emitted. At this point, any inputs contributed to the splice can only be re-spent if an
4684
+ /// [`Event::DiscardFunding`] is seen.
4685
+ ///
4686
+ /// If any failures occur while negotiating the funding transaction, an [`Event::SpliceFailed`]
4687
+ /// will be emitted. Any contributed inputs no longer used will be included here and thus can
4688
+ /// be re-spent.
4689
+ ///
4690
+ /// Once the splice has been locked by both counterparties, an [`Event::ChannelReady`] will be
4691
+ /// emitted with the new funding output.
4677
4692
#[rustfmt::skip]
4678
4693
pub fn splice_channel(
4679
4694
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey,
0 commit comments