@@ -13946,6 +13946,8 @@ where
1394613946 pub funding: FundingScope,
1394713947 pub context: ChannelContext<SP>,
1394813948 pub unfunded_context: UnfundedChannelContext,
13949+ funding_tx_locktime: LockTime,
13950+ #[allow(unused)] // TODO(dual_funding): Remove once initiating V2 channels is enabled.
1394913951 pub funding_negotiation_context: Option<FundingNegotiationContext>,
1395013952 /// The current interactive transaction construction session under negotiation.
1395113953 pub interactive_tx_constructor: Option<InteractiveTxConstructor>,
@@ -14021,6 +14023,7 @@ where
1402114023 funding,
1402214024 context,
1402314025 unfunded_context,
14026+ funding_tx_locktime,
1402414027 funding_negotiation_context: Some(funding_negotiation_context),
1402514028 interactive_tx_constructor: None,
1402614029 };
@@ -14096,7 +14099,7 @@ where
1409614099 },
1409714100 funding_feerate_sat_per_1000_weight: self.context.feerate_per_kw,
1409814101 second_per_commitment_point,
14099- locktime: self.funding_tx_locktime() .to_consensus_u32(),
14102+ locktime: self.funding_tx_locktime.to_consensus_u32(),
1410014103 require_confirmed_inputs: None,
1410114104 }
1410214105 }
@@ -14160,12 +14163,13 @@ where
1416014163 &funding.get_counterparty_pubkeys().revocation_basepoint);
1416114164 context.channel_id = channel_id;
1416214165
14166+ let funding_tx_locktime = LockTime::from_consensus(msg.locktime);
1416314167 let funding_negotiation_context = FundingNegotiationContext {
1416414168 is_initiator: false,
1416514169 our_funding_contribution: our_funding_contribution
1416614170 .to_signed()
1416714171 .expect("our_funding_contribution should not be greater than Amount::MAX_MONEY"),
14168- funding_tx_locktime: LockTime::from_consensus(msg.locktime) ,
14172+ funding_tx_locktime,
1416914173 funding_feerate_sat_per_1000_weight: msg.funding_feerate_sat_per_1000_weight,
1417014174 shared_funding_input: None,
1417114175 our_funding_inputs: our_funding_inputs.clone(),
@@ -14194,9 +14198,10 @@ where
1419414198 Ok(Self {
1419514199 funding,
1419614200 context,
14201+ unfunded_context,
14202+ funding_tx_locktime,
1419714203 funding_negotiation_context: None,
1419814204 interactive_tx_constructor: Some(interactive_tx_constructor),
14199- unfunded_context,
1420014205 })
1420114206 }
1420214207
@@ -14278,20 +14283,6 @@ where
1427814283 pub fn our_funding_contribution(&self) -> Amount {
1427914284 Amount::from_sat(self.funding.value_to_self_msat / 1000)
1428014285 }
14281-
14282- pub fn funding_tx_locktime(&self) -> LockTime {
14283- self.funding_negotiation_context
14284- .as_ref()
14285- .map(|context| context.funding_tx_locktime)
14286- .or_else(|| {
14287- self.interactive_tx_constructor
14288- .as_ref()
14289- .map(|constructor| constructor.funding_tx_locktime())
14290- })
14291- .expect(
14292- "either funding_negotiation_context or interactive_tx_constructor should be set",
14293- )
14294- }
1429514286}
1429614287
1429714288// Unfunded channel utilities
0 commit comments