From bb81598cba0a479b943f0fc885a38d741ef1e7b1 Mon Sep 17 00:00:00 2001 From: Duncan Dean Date: Fri, 6 Oct 2023 13:05:17 +0200 Subject: [PATCH] Add interactive tx constructor to all V2-related channel structs Here we add the `interactive_tx_constructor` field to the `Channel`, `OutboundV2Channel`, and `InboundV2Channel` structs. --- lightning/src/ln/channel.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 7d8c84020..926fd3beb 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -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 InboundV1Channel 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 where SP::Target: SignerProvider pub context: ChannelContext, pub unfunded_context: UnfundedChannelContext, pub dual_funding_context: DualFundingChannelContext, + /// The current interactive transaction construction session under negotiation. + interactive_tx_constructor: Option, } impl OutboundV2Channel where SP::Target: SignerProvider { @@ -8317,7 +8320,8 @@ impl OutboundV2Channel 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 where SP::Target: SignerProvider { pub context: ChannelContext, pub unfunded_context: UnfundedChannelContext, pub dual_funding_context: DualFundingChannelContext, + /// The current interactive transaction construction session under negotiation. + interactive_tx_constructor: Option, } impl InboundV2Channel where SP::Target: SignerProvider { @@ -8462,7 +8468,8 @@ impl InboundV2Channel 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) -- 2.39.5