@@ -4219,7 +4219,7 @@ where
4219
4219
/// TODO(splicing): Implementation is currently incomplete.
4220
4220
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
4221
4221
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4222
- /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4222
+ /// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
4223
4223
#[cfg(splicing)]
4224
4224
pub fn splice_channel(
4225
4225
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4237,14 +4237,12 @@ where
4237
4237
match peer_state.channel_by_id.entry(*channel_id) {
4238
4238
hash_map::Entry::Occupied(mut chan_phase_entry) => {
4239
4239
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
4240
- let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4241
- Ok(msg) => msg,
4242
- Err(err) => return Err(APIError::APIMisuseError {
4240
+ let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4241
+ .map_err(|err| APIError::APIMisuseError {
4243
4242
err: format!(
4244
4243
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
4245
4244
)
4246
- }),
4247
- };
4245
+ })?;
4248
4246
4249
4247
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
4250
4248
node_id: *counterparty_node_id,
0 commit comments