@@ -4286,7 +4286,7 @@ where
4286
4286
/// TODO(splicing): Implementation is currently incomplete.
4287
4287
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
4288
4288
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4289
- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4289
+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
4290
4290
#[cfg(splicing)]
4291
4291
pub fn splice_channel(
4292
4292
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4304,14 +4304,12 @@ where
4304
4304
match peer_state.channel_by_id.entry(*channel_id) {
4305
4305
hash_map::Entry::Occupied(mut chan_phase_entry) => {
4306
4306
if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
4307
- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4308
- Ok(msg) => msg,
4309
- Err(err) => return Err(APIError::APIMisuseError {
4307
+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4308
+ .map_err(|err| APIError::APIMisuseError {
4310
4309
err: format!(
4311
4310
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
4312
4311
)
4313
- }),
4314
- };
4312
+ })?;
4315
4313
4316
4314
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
4317
4315
node_id: *counterparty_node_id,
0 commit comments