Skip to content

Commit

Permalink
Expand documentation of splice_channel
Browse files Browse the repository at this point in the history
  • Loading branch information
optout21 committed Nov 20, 2024
1 parent 1316d2a commit 9bbdf58
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4119,7 +4119,12 @@ where
}

/// Initiate a splice, to change the channel capacity of an existing funded channel.
/// TODO(splicing): Expand documentation
/// After completion of splicing, the funding transaction will be replaced by a new one, spending the old funding transaction,
/// with optional extra inputs (splice-in) and/or extra outputs (splice-out or change).
/// TODO(splicing): Implementation is currently incomplete.
/// Note: Currently only splice-in is supported (increase in channel capacity), splice-out is not.
/// - our_funding_contribution_satoshis: the amount contributed by us to the channel. This will increase our channel balance.
/// - our_funding_inputs: the funding inputs provided by us. If our contribution is positive, our funding inputs must cover at most that amount.
#[cfg(splicing)]
pub fn splice_channel(
&self, channel_id: &ChannelId, counterparty_node_id: &PublicKey, our_funding_contribution_satoshis: i64,
Expand Down Expand Up @@ -9354,8 +9359,7 @@ where
/// Handle incoming splice request, transition channel to splice-pending (unless some check fails).
#[cfg(splicing)]
fn internal_splice_init(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceInit) -> Result<(), MsgHandleErrInternal> {
// TODO(splicing): checks
// TODO(splicing): if we accept splicing, quiscence
// TODO(splicing): if we accept splicing, quiescence

let per_peer_state = self.per_peer_state.read().unwrap();
let peer_state_mutex = per_peer_state.get(counterparty_node_id)
Expand Down Expand Up @@ -9402,9 +9406,6 @@ where
/// Handle incoming splice request ack, transition channel to splice-pending (unless some check fails).
#[cfg(splicing)]
fn internal_splice_ack(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceAck) -> Result<(), MsgHandleErrInternal> {
// TODO(splicing): checks
// TODO(splicing): check if we have initiated splicing

let per_peer_state = self.per_peer_state.read().unwrap();
let peer_state_mutex = per_peer_state.get(counterparty_node_id)
.ok_or_else(|| {
Expand Down

0 comments on commit 9bbdf58

Please sign in to comment.