Skip to content

Commit c9a9b70

Browse files
committed
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.
1 parent a499641 commit c9a9b70

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lightning/src/ln/channel.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use bitcoin::secp256k1;
2828
use crate::ln::types::ChannelId;
2929
use crate::types::payment::{PaymentPreimage, PaymentHash};
3030
use crate::types::features::{ChannelTypeFeatures, InitFeatures};
31+
use crate::ln::interactivetxs::InteractiveTxConstructor;
3132
use crate::ln::msgs;
3233
use crate::ln::msgs::{ClosingSigned, ClosingSignedFeeRange, DecodeError};
3334
use crate::ln::script::{self, ShutdownScript};
@@ -3840,6 +3841,8 @@ pub(super) struct DualFundingChannelContext {
38403841
pub(super) struct Channel<SP: Deref> where SP::Target: SignerProvider {
38413842
pub context: ChannelContext<SP>,
38423843
pub dual_funding_channel_context: Option<DualFundingChannelContext>,
3844+
/// The current interactive transaction construction session under negotiation.
3845+
interactive_tx_constructor: Option<InteractiveTxConstructor>,
38433846
}
38443847

38453848
#[cfg(any(test, fuzzing))]
@@ -8009,6 +8012,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
80098012
let mut channel = Channel {
80108013
context: self.context,
80118014
dual_funding_channel_context: None,
8015+
interactive_tx_constructor: None,
80128016
};
80138017

80148018
let need_channel_ready = channel.check_get_channel_ready(0, logger).is_some();
@@ -8117,7 +8121,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
81178121
msg.push_msat,
81188122
msg.common_fields.clone(),
81198123
)?,
8120-
unfunded_context: UnfundedChannelContext { unfunded_channel_age_ticks: 0 }
8124+
unfunded_context: UnfundedChannelContext { unfunded_channel_age_ticks: 0 },
81218125
};
81228126
Ok(chan)
81238127
}
@@ -8238,6 +8242,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
82388242
let mut channel = Channel {
82398243
context: self.context,
82408244
dual_funding_channel_context: None,
8245+
interactive_tx_constructor: None,
82418246
};
82428247
let need_channel_ready = channel.check_get_channel_ready(0, logger).is_some();
82438248
channel.monitor_updating_paused(false, false, need_channel_ready, Vec::new(), Vec::new(), Vec::new());
@@ -8251,6 +8256,8 @@ pub(super) struct OutboundV2Channel<SP: Deref> where SP::Target: SignerProvider
82518256
pub context: ChannelContext<SP>,
82528257
pub unfunded_context: UnfundedChannelContext,
82538258
pub dual_funding_context: DualFundingChannelContext,
8259+
/// The current interactive transaction construction session under negotiation.
8260+
interactive_tx_constructor: Option<InteractiveTxConstructor>,
82548261
}
82558262

82568263
impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
@@ -8302,7 +8309,8 @@ impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
83028309
their_funding_satoshis: 0,
83038310
funding_tx_locktime,
83048311
funding_feerate_sat_per_1000_weight,
8305-
}
8312+
},
8313+
interactive_tx_constructor: None,
83068314
};
83078315
Ok(chan)
83088316
}
@@ -8376,6 +8384,8 @@ pub(super) struct InboundV2Channel<SP: Deref> where SP::Target: SignerProvider {
83768384
pub context: ChannelContext<SP>,
83778385
pub unfunded_context: UnfundedChannelContext,
83788386
pub dual_funding_context: DualFundingChannelContext,
8387+
/// The current interactive transaction construction session under negotiation.
8388+
interactive_tx_constructor: Option<InteractiveTxConstructor>,
83798389
}
83808390

83818391
impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
@@ -8447,7 +8457,8 @@ impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
84478457
their_funding_satoshis: msg.common_fields.funding_satoshis,
84488458
funding_tx_locktime: msg.locktime,
84498459
funding_feerate_sat_per_1000_weight: msg.funding_feerate_sat_per_1000_weight,
8450-
}
8460+
},
8461+
interactive_tx_constructor: None,
84518462
};
84528463

84538464
Ok(chan)
@@ -9589,6 +9600,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
95899600
is_manual_broadcast: is_manual_broadcast.unwrap_or(false),
95909601
},
95919602
dual_funding_channel_context: None,
9603+
interactive_tx_constructor: None,
95929604
})
95939605
}
95949606
}

0 commit comments

Comments
 (0)