@@ -4124,7 +4124,7 @@ where
41244124 /// TODO(splicing): Implementation is currently incomplete.
41254125 /// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
41264126 /// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4127- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4127+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
41284128 #[cfg(splicing)]
41294129 pub fn splice_channel(
41304130 &self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4142,14 +4142,12 @@ where
41424142 match peer_state.channel_by_id.entry(*channel_id) {
41434143 hash_map::Entry::Occupied(mut chan_phase_entry) => {
41444144 if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
4145- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4146- Ok(msg) => msg,
4147- Err(err) => return Err(APIError::APIMisuseError {
4145+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4146+ .map_err(|err| APIError::APIMisuseError {
41484147 err: format!(
41494148 "Cannot initiate Splicing, {}, channel ID {}", err, channel_id
41504149 )
4151- }),
4152- };
4150+ })?;
41534151
41544152 peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
41554153 node_id: *counterparty_node_id,
0 commit comments