@@ -2858,13 +2858,16 @@ where
2858
2858
interactive_tx_constructor: &'a mut Option<InteractiveTxConstructor>,
2859
2859
interactive_tx_signing_session: &'a mut Option<InteractiveTxSigningSession>,
2860
2860
holder_commitment_transaction_number: u64,
2861
- is_splice: bool,
2862
2861
}
2863
2862
2864
2863
impl<'a, SP: Deref> NegotiatingChannelView<'a, SP>
2865
2864
where
2866
2865
SP::Target: SignerProvider,
2867
2866
{
2867
+ fn is_splice(&self) -> bool {
2868
+ self.funding.channel_transaction_parameters.splice_parent_funding_txid.is_some()
2869
+ }
2870
+
2868
2871
/// Prepare and start interactive transaction negotiation.
2869
2872
/// `change_destination_opt` - Optional destination for optional change; if None,
2870
2873
/// default destination address is used.
@@ -2878,7 +2881,7 @@ where
2878
2881
where
2879
2882
ES::Target: EntropySource,
2880
2883
{
2881
- if self.is_splice {
2884
+ if self.is_splice() {
2882
2885
debug_assert!(matches!(self.context.channel_state, ChannelState::ChannelReady(_)));
2883
2886
} else {
2884
2887
debug_assert!(matches!(
@@ -3087,7 +3090,7 @@ where
3087
3090
self.funding
3088
3091
.channel_transaction_parameters.funding_outpoint = Some(outpoint);
3089
3092
3090
- if self.is_splice {
3093
+ if self.is_splice() {
3091
3094
// TODO(splicing) Forced error, as the use case is not complete
3092
3095
return Err(ChannelError::Close((
3093
3096
"TODO Forced error, incomplete implementation".into(),
@@ -6207,7 +6210,6 @@ where
6207
6210
holder_commitment_transaction_number: self
6208
6211
.holder_commitment_point
6209
6212
.transaction_number(),
6210
- is_splice: true,
6211
6213
})
6212
6214
} else {
6213
6215
Err("Received unexpected interactive transaction negotiation message: \
@@ -10419,7 +10421,6 @@ where
10419
10421
interactive_tx_constructor: &mut pending_splice_mut.interactive_tx_constructor,
10420
10422
interactive_tx_signing_session: &mut pending_splice_mut.interactive_tx_signing_session,
10421
10423
holder_commitment_transaction_number: self.holder_commitment_point.transaction_number(),
10422
- is_splice: true,
10423
10424
};
10424
10425
10425
10426
// Start interactive funding negotiation. TODO(splicing): Add current funding as extra input, once shared inputs are supported, see #3842.
@@ -10541,7 +10542,6 @@ where
10541
10542
interactive_tx_constructor: &mut pending_splice.interactive_tx_constructor,
10542
10543
interactive_tx_signing_session: &mut pending_splice.interactive_tx_signing_session,
10543
10544
holder_commitment_transaction_number: self.holder_commitment_point.transaction_number(),
10544
- is_splice: true,
10545
10545
};
10546
10546
10547
10547
// Start interactive funding negotiation, with the previous funding transaction as an extra shared input
@@ -12429,7 +12429,6 @@ where
12429
12429
interactive_tx_constructor: &mut self.interactive_tx_constructor,
12430
12430
interactive_tx_signing_session: &mut self.interactive_tx_signing_session,
12431
12431
holder_commitment_transaction_number: self.unfunded_context.transaction_number(),
12432
- is_splice: false,
12433
12432
}
12434
12433
}
12435
12434
}
0 commit comments