@@ -4239,11 +4239,12 @@ where
42394239 /// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
42404240 /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
42414241 /// Includes the witness weight for this input (e.g. P2WPKH_WITNESS_WEIGHT=109 for typical P2WPKH inputs).
4242+ /// - locktime: Optional locktime for the new funding transaction. If None, set to the current block height.
42424243 #[cfg(splicing)]
42434244 pub fn splice_channel(
42444245 &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
42454246 our_funding_inputs: Vec<(TxIn, Transaction, Weight)>,
4246- funding_feerate_per_kw: u32, locktime: u32,
4247+ funding_feerate_per_kw: u32, locktime: Option< u32> ,
42474248 ) -> Result<(), APIError> {
42484249 let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
42494250 let per_peer_state = self.per_peer_state.read().unwrap();
@@ -4257,6 +4258,7 @@ where
42574258 // Look for the channel
42584259 match peer_state.channel_by_id.entry(*channel_id) {
42594260 hash_map::Entry::Occupied(mut chan_phase_entry) => {
4261+ let locktime = locktime.unwrap_or(self.current_best_block().height);
42604262 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
42614263 let msg = chan.splice_channel(our_funding_contribution_satoshis, our_funding_inputs, funding_feerate_per_kw, locktime)
42624264 .map_err(|err| APIError::APIMisuseError {
0 commit comments