Skip to content

Commit 5575f38

Browse files
committed
Minor review comments
1 parent 4791b39 commit 5575f38

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
@@ -4209,7 +4209,7 @@ where
42094209
/// TODO(splicing): Implementation is currently incomplete.
42104210
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
42114211
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
4212-
/// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
4212+
/// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at least that amount.
42134213
#[cfg(splicing)]
42144214
pub fn splice_channel(
42154215
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
@@ -4227,14 +4227,12 @@ where
42274227
match peer_state.channel_by_id.entry(*channel_id) {
42284228
hash_map::Entry::Occupied(mut chan_phase_entry) => {
42294229
if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
4230-
let msg = match chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime) {
4231-
Ok(msg) => msg,
4232-
Err(err) => return Err(APIError::APIMisuseError {
4230+
let msg = chan.splice_channel(our_funding_contribution_satoshis, funding_feerate_perkw, locktime)
4231+
.map_err(|err| APIError::APIMisuseError {
42334232
err: format!(
42344233
"Cannot initiate Splicing, {}, channel ID {}", err, channel_id
42354234
)
4236-
}),
4237-
};
4235+
})?;
42384236

42394237
peer_state.pending_msg_events.push(events::MessageSendEvent::SendSpliceInit {
42404238
node_id: *counterparty_node_id,

0 commit comments

Comments
 (0)