@@ -4219,7 +4219,7 @@ where
42194219 /// TODO(splicing): Implementation is currently incomplete.
42204220 /// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
42214221 /// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4222- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4222+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
42234223 #[cfg(splicing)]
42244224 pub fn splice_channel(
42254225 &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4237,14 +4237,12 @@ where
42374237 match peer_state.channel_by_id.entry(*channel_id) {
42384238 hash_map::Entry::Occupied(mut chan_phase_entry) => {
42394239 if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
4240- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4241- Ok(msg) => msg,
4242- Err(err) => return Err(APIError::APIMisuseError {
4240+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4241+ .map_err(|err| APIError::APIMisuseError {
42434242 err: format!(
42444243 "Cannot initiate Splicing, {}, channel ID {}", err, channel_id
42454244 )
4246- }),
4247- };
4245+ })?;
42484246
42494247 peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
42504248 node_id: *counterparty_node_id,
0 commit comments