Skip to content

Commit c29a990

Browse files
committed
Cleanup: Remove splice_start() method
1 parent 63604f5 commit c29a990

File tree

1 file changed

+7
-29
lines changed

1 file changed

+7
-29
lines changed

lightning/src/ln/channel.rs

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9231,8 +9231,8 @@ impl<SP: Deref> FundedChannel<SP> where
92319231
interactive_tx_signing_session: None,
92329232
});
92339233

9234-
// Apply start of splice change in the state
9235-
self.splice_start(false, logger);
9234+
log_info!(logger, "Splicing process started after splice_init, new channel value {}, old {}, outgoing {}, channel_id {}",
9235+
post_channel_value, pre_channel_value, false, self.context.channel_id);
92369236

92379237
let splice_ack_msg = self.get_splice_ack(our_funding_contribution);
92389238

@@ -9286,6 +9286,9 @@ impl<SP: Deref> FundedChannel<SP> where
92869286
let post_channel_value = PendingSplice::compute_post_value(pre_channel_value, our_funding_contribution, their_funding_contribution_satoshis);
92879287
let _post_balance = PendingSplice::add_checked(self.funding.value_to_self_msat, our_funding_contribution);
92889288

9289+
// TODO(splicing): Pre-check for reserve requirement
9290+
// (Note: It should also be checked later at tx_complete)
9291+
92899292
let (our_funding_satoshis, their_funding_satoshis) = calculate_funding_values(
92909293
pre_channel_value,
92919294
our_funding_contribution,
@@ -9309,16 +9312,8 @@ impl<SP: Deref> FundedChannel<SP> where
93099312
debug_assert!(pending_splice_mut.awaiting_splice_ack);
93109313
pending_splice_mut.awaiting_splice_ack = false;
93119314

9312-
// TODO(splicing): Pre-check for reserve requirement
9313-
// (Note: It should also be checked later at tx_complete)
9314-
9315-
let _post_channel_value = PendingSplice::compute_post_value(pre_channel_value, our_funding_contribution, their_funding_contribution_satoshis);
9316-
let _post_balance = PendingSplice::add_checked(self.funding.value_to_self_msat, our_funding_contribution);
9317-
// TODO: Early check for reserve requirement, assuming maximum balance of full channel value
9318-
// This will also be checked later at tx_complete
9319-
9320-
// Apply start of splice change in the state
9321-
self.splice_start(true, logger);
9315+
log_info!(logger, "Splicing process started after splice_ack, new channel value {}, old {}, outgoing {}, channel_id {}",
9316+
post_channel_value, pre_channel_value, true, self.context.channel_id);
93229317

93239318
// Start interactive funding negotiation, with the previous funding transaction as an extra shared input
93249319
let mut refunding = self.as_renegotiating_channel()
@@ -9351,23 +9346,6 @@ impl<SP: Deref> FundedChannel<SP> where
93519346
}
93529347
}
93539348

9354-
/// Splice process starting; update state, log, etc.
9355-
#[cfg(splicing)]
9356-
pub(crate) fn splice_start<L: Deref>(&mut self, is_outgoing: bool, logger: &L) where L::Target: Logger {
9357-
// Set state, by this point splice_init/splice_ack handshake is complete
9358-
// TODO(splicing)
9359-
// self.channel_state = ChannelState::NegotiatingFunding(
9360-
// NegotiatingFundingFlags::OUR_INIT_SENT | NegotiatingFundingFlags::THEIR_INIT_SENT
9361-
// );
9362-
if let Some(pending_splice) = &self.pending_splice {
9363-
if let Some(funding_scope) = &pending_splice.funding_scope {
9364-
let old_value = self.funding.get_value_satoshis();
9365-
log_info!(logger, "Splicing process started, new channel value {}, old {}, outgoing {}, channel_id {}",
9366-
funding_scope.get_value_satoshis(), old_value, is_outgoing, self.context().channel_id);
9367-
}
9368-
}
9369-
}
9370-
93719349
// Send stuff to our remote peers:
93729350

93739351
/// Queues up an outbound HTLC to send by placing it in the holding cell. You should call

0 commit comments

Comments
 (0)