@@ -2199,6 +2199,7 @@ impl FundingScope {
21992199 let post_value_to_self_msat = post_value_to_self_msat_signed as u64;
22002200
22012201 let prev_funding_txid = prev_funding.get_funding_txid();
2202+ // Update the splicing 'tweak', this will rotate the keys in the signer
22022203 let holder_pubkeys = match &context.holder_signer {
22032204 ChannelSignerType::Ecdsa(ecdsa) => ecdsa.pubkeys(prev_funding_txid, &context.secp_ctx),
22042205 // TODO (taproot|arik)
@@ -2217,7 +2218,6 @@ impl FundingScope {
22172218 channel_type_features: channel_parameters.channel_type_features.clone(),
22182219 channel_value_satoshis: post_channel_value,
22192220 };
2220- // Update the splicing 'tweak', this will rotate the keys in the signer
22212221 if let Some(ref mut counterparty_parameters) =
22222222 post_channel_transaction_parameters.counterparty_parameters
22232223 {
@@ -2880,6 +2880,8 @@ where
28802880 SP::Target: SignerProvider,
28812881{
28822882 context: &'a mut ChannelContext<SP>,
2883+ /// The funding scope being (re)negotiated.
2884+ /// In case of splicing it is the new spliced scope.
28832885 funding: &'a mut FundingScope,
28842886 funding_negotiation_context: &'a mut FundingNegotiationContext,
28852887 interactive_tx_constructor: &'a mut Option<InteractiveTxConstructor>,
@@ -3129,8 +3131,6 @@ where
31293131 let commitment_signed = self.context.get_initial_commitment_signed(&self.funding, logger);
31303132 let commitment_signed = match commitment_signed {
31313133 Ok(commitment_signed) => {
3132- self.funding
3133- .funding_transaction = Some(signing_session.unsigned_tx().build_unsigned_tx());
31343134 commitment_signed
31353135 },
31363136 Err(err) => {
@@ -6227,28 +6227,17 @@ where
62276227 fn as_renegotiating_channel(&mut self) -> Result<NegotiatingChannelView<SP>, &'static str> {
62286228 if let Some(ref mut pending_splice) = &mut self.pending_splice {
62296229 if let Some(ref mut funding) = &mut pending_splice.funding {
6230- if pending_splice.funding_negotiation_context.our_funding_satoshis != 0
6231- || pending_splice
6232- .funding_negotiation_context
6233- .their_funding_satoshis
6234- .unwrap_or_default() != 0
6235- {
6236- Ok(NegotiatingChannelView {
6237- context: &mut self.context,
6238- funding,
6239- funding_negotiation_context: &mut pending_splice
6240- .funding_negotiation_context,
6241- interactive_tx_constructor: &mut pending_splice.interactive_tx_constructor,
6242- interactive_tx_signing_session: &mut pending_splice
6243- .interactive_tx_signing_session,
6244- holder_commitment_transaction_number: self
6245- .holder_commitment_point
6246- .transaction_number(),
6247- })
6248- } else {
6249- Err("Received unexpected interactive transaction negotiation message: \
6250- the channel is splicing, but splice_init/splice_ack has not been exchanged yet")
6251- }
6230+ Ok(NegotiatingChannelView {
6231+ context: &mut self.context,
6232+ funding,
6233+ funding_negotiation_context: &mut pending_splice.funding_negotiation_context,
6234+ interactive_tx_constructor: &mut pending_splice.interactive_tx_constructor,
6235+ interactive_tx_signing_session: &mut pending_splice
6236+ .interactive_tx_signing_session,
6237+ holder_commitment_transaction_number: self
6238+ .holder_commitment_point
6239+ .transaction_number(),
6240+ })
62526241 } else {
62536242 Err("Received unexpected interactive transaction negotiation message: \
62546243 the channel is splicing, but splice_init/splice_ack has not been exchanged yet")
@@ -10478,9 +10467,9 @@ where
1047810467 // Convert inputs
1047910468 let mut funding_inputs = Vec::new();
1048010469 for (tx_in, tx, _w) in our_funding_inputs.into_iter() {
10481- let tx16 = TransactionU16LenLimited::new(tx.clone() )
10470+ let tx16 = TransactionU16LenLimited::new(tx)
1048210471 .map_err(|_e| APIError::APIMisuseError { err: format!("Too large transaction") })?;
10483- funding_inputs.push((tx_in.clone() , tx16));
10472+ funding_inputs.push((tx_in, tx16));
1048410473 }
1048510474
1048610475 let funding_negotiation_context = FundingNegotiationContext {
@@ -10708,9 +10697,7 @@ where
1070810697
1070910698 // TODO(splicing): Add check that we are the splice (quiescence) initiator
1071010699
10711- if pending_splice.funding.is_some()
10712- || pending_splice.interactive_tx_constructor.is_some()
10713- {
10700+ if pending_splice.funding.is_some() || pending_splice.interactive_tx_constructor.is_some() {
1071410701 return Err(ChannelError::Warn(format!(
1071510702 "Got unexpected splice_ack, splice already negotiating"
1071610703 )));
0 commit comments