@@ -4226,7 +4226,7 @@ where
4226
4226
/// TODO(splicing): Implementation is currently incomplete.
4227
4227
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
4228
4228
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4229
- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4229
+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
4230
4230
#[cfg(splicing)]
4231
4231
pub fn splice_channel(
4232
4232
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4244,14 +4244,12 @@ where
4244
4244
match peer_state.channel_by_id.entry(*channel_id) {
4245
4245
hash_map::Entry::Occupied(mut chan_phase_entry) => {
4246
4246
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
4247
- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4248
- Ok(msg) => msg,
4249
- Err(err) => return Err(APIError::APIMisuseError {
4247
+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4248
+ .map_err(|err| APIError::APIMisuseError {
4250
4249
err: format!(
4251
4250
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
4252
4251
)
4253
- }),
4254
- };
4252
+ })?;
4255
4253
4256
4254
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
4257
4255
node_id: *counterparty_node_id,
0 commit comments