@@ -1255,9 +1255,6 @@ impl<SP: Deref> Channel<SP> where
1255
1255
pub fn unfunded_context_mut(&mut self) -> Option<&mut UnfundedChannelContext> {
1256
1256
match &mut self.phase {
1257
1257
ChannelPhase::Undefined => unreachable!(),
1258
- #[cfg(not(splicing))]
1259
- ChannelPhase::Funded(_) => { debug_assert!(false); None }
1260
- #[cfg(splicing)]
1261
1258
ChannelPhase::Funded(_chan) => {
1262
1259
debug_assert!(false, "FundedChannel is not unfunded!");
1263
1260
None
@@ -2481,7 +2478,7 @@ impl<'a, SP: Deref> FundingTxConstructorV2<SP> for FundedChannelRefundingWrapper
2481
2478
&mut self.refunding_scope.pending_funding_negotiation_context
2482
2479
}
2483
2480
2484
- fn transaction_number (&self) -> u64 {
2481
+ fn current_holder_transaction_number (&self) -> u64 {
2485
2482
self.holder_commitment_point.transaction_number()
2486
2483
}
2487
2484
@@ -2509,7 +2506,7 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2509
2506
fn pending_funding_and_context_mut(&mut self) -> (&FundingScope, &mut ChannelContext<SP>);
2510
2507
fn funding_negotiation_context(&self) -> &FundingNegotiationContext;
2511
2508
fn funding_negotiation_context_mut(&mut self) -> &mut FundingNegotiationContext;
2512
- fn transaction_number (&self) -> u64;
2509
+ fn current_holder_transaction_number (&self) -> u64;
2513
2510
fn interactive_tx_constructor(&self) -> Option<&InteractiveTxConstructor>;
2514
2511
fn interactive_tx_constructor_mut(&mut self) -> &mut Option<InteractiveTxConstructor>;
2515
2512
fn interactive_tx_signing_session_mut(&mut self) -> &mut Option<InteractiveTxSigningSession>;
@@ -2694,7 +2691,7 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2694
2691
{
2695
2692
let our_funding_satoshis = self.funding_negotiation_context()
2696
2693
.our_funding_satoshis;
2697
- let transaction_number = self.transaction_number ();
2694
+ let transaction_number = self.current_holder_transaction_number ();
2698
2695
let pending_funding = self.pending_funding();
2699
2696
2700
2697
let mut output_index = None;
@@ -2825,7 +2822,7 @@ impl<SP: Deref> FundingTxConstructorV2<SP> for PendingV2Channel<SP> where SP::Ta
2825
2822
&mut self.funding_negotiation_context
2826
2823
}
2827
2824
2828
- fn transaction_number (&self) -> u64 {
2825
+ fn current_holder_transaction_number (&self) -> u64 {
2829
2826
self.unfunded_context.transaction_number()
2830
2827
}
2831
2828
@@ -8939,7 +8936,7 @@ impl<SP: Deref> FundedChannel<SP> where
8939
8936
/// Includes the witness weight for this input (e.g. P2WPKH_WITNESS_WEIGHT=109 for typical P2WPKH inputs).
8940
8937
#[cfg(splicing)]
8941
8938
pub fn splice_channel(&mut self, our_funding_contribution_satoshis: i64,
8942
- our_funding_inputs: & Vec<(TxIn, Transaction, Weight)>,
8939
+ our_funding_inputs: Vec<(TxIn, Transaction, Weight)>,
8943
8940
funding_feerate_per_kw: u32, locktime: u32,
8944
8941
) -> Result<msgs::SpliceInit, APIError> {
8945
8942
// Check if a splice has been initiated already.
@@ -9073,7 +9070,7 @@ impl<SP: Deref> FundedChannel<SP> where
9073
9070
{
9074
9071
let _res = self.splice_init_checks(msg)?;
9075
9072
9076
- let pre_channel_value = self.funding() .get_value_satoshis();
9073
+ let pre_channel_value = self.funding.get_value_satoshis();
9077
9074
let their_funding_contribution = msg.funding_contribution_satoshis;
9078
9075
9079
9076
let post_channel_value = PendingSplice::compute_post_value(pre_channel_value, our_funding_contribution, their_funding_contribution);
@@ -9085,13 +9082,13 @@ impl<SP: Deref> FundedChannel<SP> where
9085
9082
false, // is_outbound
9086
9083
)?;
9087
9084
9088
- let post_value_to_self_msat = self.funding() .value_to_self_msat.saturating_add(our_funding_satoshis);
9085
+ let post_value_to_self_msat = self.funding.value_to_self_msat.saturating_add(our_funding_satoshis);
9089
9086
9090
- let mut post_channel_transaction_parameters = self.funding() .channel_transaction_parameters.clone();
9087
+ let mut post_channel_transaction_parameters = self.funding.channel_transaction_parameters.clone();
9091
9088
post_channel_transaction_parameters.channel_value_satoshis = post_channel_value;
9092
9089
// Update the splicing 'tweak', this will rotate the keys in the signer
9093
- let prev_funding_txid = self.funding.funding_transaction.as_ref()
9094
- .map(|tx| tx.compute_txid() );
9090
+ let prev_funding_txid = self.funding.channel_transaction_parameters.funding_outpoint
9091
+ .map(|outpoint| outpoint.txid );
9095
9092
post_channel_transaction_parameters.splice_parent_funding_txid = prev_funding_txid;
9096
9093
match &self.context.holder_signer {
9097
9094
ChannelSignerType::Ecdsa(ecdsa) => {
@@ -9210,13 +9207,13 @@ impl<SP: Deref> FundedChannel<SP> where
9210
9207
true, // is_outbound
9211
9208
)?;
9212
9209
9213
- let post_value_to_self_msat = self.funding() .value_to_self_msat.saturating_add(our_funding_satoshis);
9210
+ let post_value_to_self_msat = self.funding.value_to_self_msat.saturating_add(our_funding_satoshis);
9214
9211
9215
- let mut post_channel_transaction_parameters = self.funding() .channel_transaction_parameters.clone();
9212
+ let mut post_channel_transaction_parameters = self.funding.channel_transaction_parameters.clone();
9216
9213
post_channel_transaction_parameters.channel_value_satoshis = post_channel_value;
9217
9214
// Update the splicing 'tweak', this will rotate the keys in the signer
9218
- let prev_funding_txid = self.funding.funding_transaction.as_ref()
9219
- .map(|tx| tx.compute_txid() );
9215
+ let prev_funding_txid = self.funding.channel_transaction_parameters.funding_outpoint
9216
+ .map(|outpoint| outpoint.txid );
9220
9217
post_channel_transaction_parameters.splice_parent_funding_txid = prev_funding_txid;
9221
9218
match &self.context.holder_signer {
9222
9219
ChannelSignerType::Ecdsa(ecdsa) => {
0 commit comments