@@ -4209,7 +4209,7 @@ where
4209
4209
/// TODO(splicing): Implementation is currently incomplete.
4210
4210
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
4211
4211
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4212
- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4212
+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
4213
4213
#[cfg(splicing)]
4214
4214
pub fn splice_channel(
4215
4215
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4227,14 +4227,12 @@ where
4227
4227
match peer_state.channel_by_id.entry(*channel_id) {
4228
4228
hash_map::Entry::Occupied(mut chan_phase_entry) => {
4229
4229
if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
4230
- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4231
- Ok(msg) => msg,
4232
- Err(err) => return Err(APIError::APIMisuseError {
4230
+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4231
+ .map_err(|err| APIError::APIMisuseError {
4233
4232
err: format!(
4234
4233
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
4235
4234
)
4236
- }),
4237
- };
4235
+ })?;
4238
4236
4239
4237
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
4240
4238
node_id: *counterparty_node_id,
0 commit comments