@@ -4124,7 +4124,7 @@ where
4124
4124
/// TODO(splicing): Implementation is currently incomplete.
4125
4125
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
4126
4126
/// - 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.
4128
4128
#[cfg(splicing)]
4129
4129
pub fn splice_channel(
4130
4130
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4142,14 +4142,12 @@ where
4142
4142
match peer_state.channel_by_id.entry(*channel_id) {
4143
4143
hash_map::Entry::Occupied(mut chan_phase_entry) => {
4144
4144
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 {
4148
4147
err: format!(
4149
4148
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
4150
4149
)
4151
- }),
4152
- };
4150
+ })?;
4153
4151
4154
4152
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
4155
4153
node_id: *counterparty_node_id,
0 commit comments