@@ -4239,7 +4239,7 @@ where
4239
4239
/// TODO(splicing): Implementation is currently incomplete.
4240
4240
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
4241
4241
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4242
- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4242
+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
4243
4243
#[cfg(splicing)]
4244
4244
pub fn splice_channel(
4245
4245
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4257,14 +4257,12 @@ where
4257
4257
match peer_state.channel_by_id.entry(*channel_id) {
4258
4258
hash_map::Entry::Occupied(mut chan_phase_entry) => {
4259
4259
if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
4260
- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4261
- Ok(msg) => msg,
4262
- Err(err) => return Err(APIError::APIMisuseError {
4260
+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4261
+ .map_err(|err| APIError::APIMisuseError {
4263
4262
err: format!(
4264
4263
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
4265
4264
)
4266
- }),
4267
- };
4265
+ })?;
4268
4266
4269
4267
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
4270
4268
node_id: *counterparty_node_id,
0 commit comments