@@ -2885,13 +2885,16 @@ where
2885
2885
interactive_tx_constructor: &'a mut Option<InteractiveTxConstructor>,
2886
2886
interactive_tx_signing_session: &'a mut Option<InteractiveTxSigningSession>,
2887
2887
holder_commitment_transaction_number: u64,
2888
- is_splice: bool,
2889
2888
}
2890
2889
2891
2890
impl<'a, SP: Deref> NegotiatingChannelView<'a, SP>
2892
2891
where
2893
2892
SP::Target: SignerProvider,
2894
2893
{
2894
+ fn is_splice(&self) -> bool {
2895
+ self.funding.channel_transaction_parameters.splice_parent_funding_txid.is_some()
2896
+ }
2897
+
2895
2898
/// Prepare and start interactive transaction negotiation.
2896
2899
/// `change_destination_opt` - Optional destination for optional change; if None,
2897
2900
/// default destination address is used.
@@ -2905,7 +2908,7 @@ where
2905
2908
where
2906
2909
ES::Target: EntropySource,
2907
2910
{
2908
- if self.is_splice {
2911
+ if self.is_splice() {
2909
2912
debug_assert!(matches!(self.context.channel_state, ChannelState::ChannelReady(_)));
2910
2913
} else {
2911
2914
debug_assert!(matches!(
@@ -3114,7 +3117,7 @@ where
3114
3117
self.funding
3115
3118
.channel_transaction_parameters.funding_outpoint = Some(outpoint);
3116
3119
3117
- if self.is_splice {
3120
+ if self.is_splice() {
3118
3121
// TODO(splicing) Forced error, as the use case is not complete
3119
3122
return Err(ChannelError::Close((
3120
3123
"TODO Forced error, incomplete implementation".into(),
@@ -6241,7 +6244,6 @@ where
6241
6244
holder_commitment_transaction_number: self
6242
6245
.holder_commitment_point
6243
6246
.transaction_number(),
6244
- is_splice: true,
6245
6247
})
6246
6248
} else {
6247
6249
Err("Received unexpected interactive transaction negotiation message: \
@@ -10650,7 +10652,6 @@ where
10650
10652
interactive_tx_constructor: &mut pending_splice_mut.interactive_tx_constructor,
10651
10653
interactive_tx_signing_session: &mut pending_splice_mut.interactive_tx_signing_session,
10652
10654
holder_commitment_transaction_number: self.holder_commitment_point.transaction_number(),
10653
- is_splice: true,
10654
10655
};
10655
10656
10656
10657
// Start interactive funding negotiation. TODO(splicing): Add current funding as extra input, once shared inputs are supported, see #3842.
@@ -10772,7 +10773,6 @@ where
10772
10773
interactive_tx_constructor: &mut pending_splice.interactive_tx_constructor,
10773
10774
interactive_tx_signing_session: &mut pending_splice.interactive_tx_signing_session,
10774
10775
holder_commitment_transaction_number: self.holder_commitment_point.transaction_number(),
10775
- is_splice: true,
10776
10776
};
10777
10777
10778
10778
// Start interactive funding negotiation, with the previous funding transaction as an extra shared input
@@ -12660,7 +12660,6 @@ where
12660
12660
interactive_tx_constructor: &mut self.interactive_tx_constructor,
12661
12661
interactive_tx_signing_session: &mut self.interactive_tx_signing_session,
12662
12662
holder_commitment_transaction_number: self.unfunded_context.transaction_number(),
12663
- is_splice: false,
12664
12663
}
12665
12664
}
12666
12665
}
0 commit comments