@@ -4286,7 +4286,7 @@ where
42864286 /// TODO(splicing): Implementation is currently incomplete.
42874287 /// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
42884288 /// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4289- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4289+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
42904290 #[cfg(splicing)]
42914291 pub fn splice_channel(
42924292 &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4304,14 +4304,12 @@ where
43044304 match peer_state.channel_by_id.entry(*channel_id) {
43054305 hash_map::Entry::Occupied(mut chan_phase_entry) => {
43064306 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
4307- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4308- Ok(msg) => msg,
4309- Err(err) => return Err(APIError::APIMisuseError {
4307+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4308+ .map_err(|err| APIError::APIMisuseError {
43104309 err: format!(
43114310 "Cannot initiate Splicing, {}, channel ID {}", err, channel_id
43124311 )
4313- }),
4314- };
4312+ })?;
43154313
43164314 peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
43174315 node_id: *counterparty_node_id,
0 commit comments