Skip to content

Commit

Permalink
Temporarily allow some unused dual-funding code
Browse files Browse the repository at this point in the history
  • Loading branch information
dunxen committed Oct 7, 2024
1 parent bfa2d88 commit 7e1cde2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ impl_writeable_tlv_based!(PendingChannelMonitorUpdate, {
pub(super) enum ChannelPhase<SP: Deref> where SP::Target: SignerProvider {
UnfundedOutboundV1(OutboundV1Channel<SP>),
UnfundedInboundV1(InboundV1Channel<SP>),
#[allow(dead_code)] // TODO(dual_funding): Remove once creating V2 channels is enabled.
UnfundedOutboundV2(OutboundV2Channel<SP>),
UnfundedInboundV2(InboundV2Channel<SP>),
Funded(Channel<SP>),
Expand Down Expand Up @@ -3983,6 +3984,7 @@ pub(super) fn calculate_our_funding_satoshis(
pub(super) struct DualFundingChannelContext {
/// The amount in satoshis we will be contributing to the channel.
pub our_funding_satoshis: u64,
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
/// The amount in satoshis our counterparty will be contributing to the channel.
pub their_funding_satoshis: Option<u64>,
/// The funding transaction locktime suggested by the initiator. If set by us, it is always set
Expand All @@ -4002,6 +4004,7 @@ pub(super) struct DualFundingChannelContext {
// Counterparty designates channel data owned by the another channel participant entity.
pub(super) struct Channel<SP: Deref> where SP::Target: SignerProvider {
pub context: ChannelContext<SP>,
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
pub dual_funding_channel_context: Option<DualFundingChannelContext>,
/// The current interactive transaction construction session under negotiation.
pub interactive_tx_constructor: Option<InteractiveTxConstructor>,
Expand Down Expand Up @@ -8660,6 +8663,7 @@ pub(super) struct OutboundV2Channel<SP: Deref> where SP::Target: SignerProvider
}

impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
#[allow(dead_code)] // TODO(dual_funding): Remove once creating V2 channels is enabled.
pub fn new<ES: Deref, F: Deref, L: Deref>(
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
counterparty_node_id: PublicKey, their_features: &InitFeatures, funding_satoshis: u64,
Expand Down Expand Up @@ -8982,6 +8986,7 @@ impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
///
/// [`msgs::AcceptChannelV2`]: crate::ln::msgs::AcceptChannelV2
#[cfg(test)]
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
pub fn get_accept_channel_v2_message(&self) -> msgs::AcceptChannelV2 {
self.generate_accept_channel_v2_message()
}
Expand Down
1 change: 1 addition & 0 deletions lightning/src/ln/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ mod async_signer_tests;
#[cfg(test)]
#[allow(unused_mut)]
mod offers_tests;
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
pub(crate) mod interactivetxs;

pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;

0 comments on commit 7e1cde2

Please sign in to comment.