@@ -4286,11 +4286,12 @@ where
4286
4286
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4287
4287
/// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
4288
4288
/// Includes the witness weight for this input (e.g. P2WPKH_WITNESS_WEIGHT=109 for typical P2WPKH inputs).
4289
+ /// - locktime: Optional locktime for the new funding transaction. If None, set to the current block height.
4289
4290
#[cfg(splicing)]
4290
4291
pub fn splice_channel(
4291
4292
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
4292
4293
our_funding_inputs: Vec<(TxIn, Transaction, Weight)>,
4293
- funding_feerate_per_kw: u32, locktime: u32,
4294
+ funding_feerate_per_kw: u32, locktime: Option< u32> ,
4294
4295
) -> Result<(), APIError> {
4295
4296
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
4296
4297
let per_peer_state = self.per_peer_state.read().unwrap();
@@ -4304,6 +4305,7 @@ where
4304
4305
// Look for the channel
4305
4306
match peer_state.channel_by_id.entry(*channel_id) {
4306
4307
hash_map::Entry::Occupied(mut chan_phase_entry) => {
4308
+ let locktime = locktime.unwrap_or(self.current_best_block().height);
4307
4309
if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
4308
4310
let msg = chan.splice_channel(our_funding_contribution_satoshis, our_funding_inputs, funding_feerate_per_kw, locktime)
4309
4311
.map_err(|err| APIError::APIMisuseError {
0 commit comments