Skip to content

Commit da22994

Browse files
committed
Minor review comments
1 parent a0346b6 commit da22994

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4226,7 +4226,7 @@ where
42264226
/// TODO(splicing): Implementation is currently incomplete.
42274227
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
42284228
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4229-
/// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4229+
/// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
42304230
#[cfg(splicing)]
42314231
pub fn splice_channel(
42324232
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4244,14 +4244,12 @@ where
42444244
match peer_state.channel_by_id.entry(*channel_id) {
42454245
hash_map::Entry::Occupied(mut chan_phase_entry) => {
42464246
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
4247-
let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4248-
Ok(msg) => msg,
4249-
Err(err) => return Err(APIError::APIMisuseError {
4247+
let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4248+
.map_err(|err| APIError::APIMisuseError {
42504249
err: format!(
42514250
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
42524251
)
4253-
}),
4254-
};
4252+
})?;
42554253

42564254
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
42574255
node_id: *counterparty_node_id,

0 commit comments

Comments
 (0)