]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add interactive tx constructor to all V2-related channel structs
authorDuncan Dean <git@dunxen.dev>
Fri, 6 Oct 2023 11:05:17 +0000 (13:05 +0200)
committerDuncan Dean <git@dunxen.dev>
Mon, 18 Nov 2024 13:19:00 +0000 (15:19 +0200)
Here we add the `interactive_tx_constructor` field to the `Channel`,
`OutboundV2Channel`, and `InboundV2Channel` structs.

lightning/src/ln/channel.rs

index 7d8c84020b9ac1f2766ca150cc18c63cc117df97..926fd3beb1e1e5c8151a2019e187d45375f9f40b 100644 (file)
@@ -28,6 +28,7 @@ use bitcoin::secp256k1;
 use crate::ln::types::ChannelId;
 use crate::types::payment::{PaymentPreimage, PaymentHash};
 use crate::types::features::{ChannelTypeFeatures, InitFeatures};
+use crate::ln::interactivetxs::InteractiveTxConstructor;
 use crate::ln::msgs;
 use crate::ln::msgs::{ClosingSigned, ClosingSignedFeeRange, DecodeError};
 use crate::ln::script::{self, ShutdownScript};
@@ -8132,7 +8133,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
                                msg.push_msat,
                                msg.common_fields.clone(),
                        )?,
-                       unfunded_context: UnfundedChannelContext { unfunded_channel_age_ticks: 0 }
+                       unfunded_context: UnfundedChannelContext { unfunded_channel_age_ticks: 0 },
                };
                Ok(chan)
        }
@@ -8266,6 +8267,8 @@ pub(super) struct OutboundV2Channel<SP: Deref> where SP::Target: SignerProvider
        pub context: ChannelContext<SP>,
        pub unfunded_context: UnfundedChannelContext,
        pub dual_funding_context: DualFundingChannelContext,
+       /// The current interactive transaction construction session under negotiation.
+       interactive_tx_constructor: Option<InteractiveTxConstructor>,
 }
 
 impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
@@ -8317,7 +8320,8 @@ impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
                                their_funding_satoshis: 0,
                                funding_tx_locktime,
                                funding_feerate_sat_per_1000_weight,
-                       }
+                       },
+                       interactive_tx_constructor: None,
                };
                Ok(chan)
        }
@@ -8391,6 +8395,8 @@ pub(super) struct InboundV2Channel<SP: Deref> where SP::Target: SignerProvider {
        pub context: ChannelContext<SP>,
        pub unfunded_context: UnfundedChannelContext,
        pub dual_funding_context: DualFundingChannelContext,
+       /// The current interactive transaction construction session under negotiation.
+       interactive_tx_constructor: Option<InteractiveTxConstructor>,
 }
 
 impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
@@ -8462,7 +8468,8 @@ impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
                                their_funding_satoshis: msg.common_fields.funding_satoshis,
                                funding_tx_locktime: msg.locktime,
                                funding_feerate_sat_per_1000_weight: msg.funding_feerate_sat_per_1000_weight,
-                       }
+                       },
+                       interactive_tx_constructor: None,
                };
 
                Ok(chan)