@@ -4123,7 +4123,7 @@ where
4123
4123
/// TODO(splicing): Implementation is currently incomplete.
4124
4124
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
4125
4125
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4126
- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4126
+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
4127
4127
#[cfg(splicing)]
4128
4128
pub fn splice_channel(
4129
4129
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4141,14 +4141,12 @@ where
4141
4141
match peer_state.channel_by_id.entry(*channel_id) {
4142
4142
hash_map::Entry::Occupied(mut chan_phase_entry) => {
4143
4143
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
4144
- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4145
- Ok(msg) => msg,
4146
- Err(err) => return Err(APIError::APIMisuseError {
4144
+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4145
+ .map_err(|err| APIError::APIMisuseError {
4147
4146
err: format!(
4148
4147
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
4149
4148
)
4150
- }),
4151
- };
4149
+ })?;
4152
4150
4153
4151
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
4154
4152
node_id: *counterparty_node_id,
0 commit comments