Skip to content

Commit d7bb05f

Browse files
committed
fix Field rename, comments cleanup
1 parent 07339ed commit d7bb05f

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

lightning/src/ln/channel.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ impl<SP: Deref> Channel<SP> where
15191519
holder_commitment_point,
15201520
is_v2_established: true,
15211521
#[cfg(splicing)]
1522-
pending_splice_pre: None,
1522+
pending_splice: None,
15231523
};
15241524
let res = funded_channel.commitment_signed_initial_v2(msg, best_block, signer_provider, logger)
15251525
.map(|monitor| (Some(monitor), None))
@@ -4694,14 +4694,14 @@ fn estimate_v2_funding_transaction_fee(
46944694
fee_for_weight(funding_feerate_sat_per_1000_weight, weight)
46954695
}
46964696

4697-
/// Verify that the provided inputs by a counterparty to the funding transaction are enough
4698-
/// to cover the intended contribution amount *plus* the proportional fees of the counterparty.
4697+
/// Verify that the provided inputs to the funding transaction are enough
4698+
/// to cover the intended contribution amount *plus* the proportional fees.
46994699
/// Fees are computed using `estimate_v2_funding_transaction_fee`, and contain
47004700
/// the fees of the inputs, fees of the inputs weight, and for the initiator,
47014701
/// the fees of the common fields as well as the output and extra input weights.
47024702
/// Returns estimated (partial) fees as additional information
47034703
#[cfg(splicing)]
4704-
pub(super) fn check_v2_funding_inputs_sufficient(
4704+
fn check_v2_funding_inputs_sufficient(
47054705
contribution_amount: i64, funding_inputs: &[(TxIn, Transaction, Weight)], is_initiator: bool,
47064706
is_splice: bool, funding_feerate_sat_per_1000_weight: u32,
47074707
) -> Result<u64, ChannelError> {
@@ -4777,7 +4777,7 @@ pub(super) struct FundedChannel<SP: Deref> where SP::Target: SignerProvider {
47774777
is_v2_established: bool,
47784778
/// Info about an in-progress, pending splice (if any), on the pre-splice channel
47794779
#[cfg(splicing)]
4780-
pending_splice_pre: Option<PendingSplice>,
4780+
pending_splice: Option<PendingSplice>,
47814781
}
47824782

47834783
#[cfg(any(test, fuzzing))]
@@ -8415,7 +8415,7 @@ impl<SP: Deref> FundedChannel<SP> where
84158415
) -> Result<msgs::SpliceInit, APIError> {
84168416
// Check if a splice has been initiated already.
84178417
// Note: only a single outstanding splice is supported (per spec)
8418-
if let Some(splice_info) = &self.pending_splice_pre {
8418+
if let Some(splice_info) = &self.pending_splice {
84198419
return Err(APIError::APIMisuseError { err: format!(
84208420
"Channel {} cannot be spliced, as it has already a splice pending (contribution {})",
84218421
self.context.channel_id(), splice_info.our_funding_contribution
@@ -8452,7 +8452,7 @@ impl<SP: Deref> FundedChannel<SP> where
84528452
self.context.channel_id(), err,
84538453
)})?;
84548454

8455-
self.pending_splice_pre = Some(PendingSplice {
8455+
self.pending_splice = Some(PendingSplice {
84568456
our_funding_contribution: our_funding_contribution_satoshis,
84578457
});
84588458

@@ -8486,8 +8486,7 @@ impl<SP: Deref> FundedChannel<SP> where
84868486
let our_funding_contribution_satoshis = 0i64;
84878487

84888488
// Check if a splice has been initiated already.
8489-
// Note: this could be handled more nicely, and support multiple outstanding splice's, the incoming splice_ack matters anyways.
8490-
if let Some(splice_info) = &self.pending_splice_pre {
8489+
if let Some(splice_info) = &self.pending_splice {
84918490
return Err(ChannelError::Warn(format!(
84928491
"Channel has already a splice pending, contribution {}", splice_info.our_funding_contribution,
84938492
)));
@@ -8541,7 +8540,7 @@ impl<SP: Deref> FundedChannel<SP> where
85418540
#[cfg(splicing)]
85428541
pub fn splice_ack(&mut self, _msg: &msgs::SpliceAck) -> Result<(), ChannelError> {
85438542
// check if splice is pending
8544-
if self.pending_splice_pre.is_none() {
8543+
if self.pending_splice.is_none() {
85458544
return Err(ChannelError::Warn(format!("Channel is not in pending splice")));
85468545
};
85478546

@@ -9470,7 +9469,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
94709469
is_v2_established: false,
94719470
holder_commitment_point,
94729471
#[cfg(splicing)]
9473-
pending_splice_pre: None,
9472+
pending_splice: None,
94749473
};
94759474

94769475
let need_channel_ready = channel.check_get_channel_ready(0, logger).is_some()
@@ -9739,7 +9738,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
97399738
is_v2_established: false,
97409739
holder_commitment_point,
97419740
#[cfg(splicing)]
9742-
pending_splice_pre: None,
9741+
pending_splice: None,
97439742
};
97449743
let need_channel_ready = channel.check_get_channel_ready(0, logger).is_some()
97459744
|| channel.context.signer_pending_channel_ready;
@@ -11101,7 +11100,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
1110111100
is_v2_established,
1110211101
holder_commitment_point,
1110311102
#[cfg(splicing)]
11104-
pending_splice_pre: None,
11103+
pending_splice: None,
1110511104
})
1110611105
}
1110711106
}

lightning/src/ln/channelmanager.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9544,8 +9544,6 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
95449544
/// Handle incoming splice request, transition channel to splice-pending (unless some check fails).
95459545
#[cfg(splicing)]
95469546
fn internal_splice_init(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceInit) -> Result<(), MsgHandleErrInternal> {
9547-
// TODO(splicing): if we accept splicing, quiescence
9548-
95499547
let per_peer_state = self.per_peer_state.read().unwrap();
95509548
let peer_state_mutex = per_peer_state.get(counterparty_node_id)
95519549
.ok_or_else(|| {

0 commit comments

Comments
 (0)