@@ -2259,7 +2259,7 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
22592259 self.context.holder_signer.as_mut().provide_channel_parameters(&self.context.channel_transaction_parameters);
22602260
22612261 self.context.assert_no_commitment_advancement(transaction_number, "initial commitment_signed");
2262- let commitment_signed = self.context_mut() .get_initial_commitment_signed(logger);
2262+ let commitment_signed = self.context .get_initial_commitment_signed(logger);
22632263 let commitment_signed = match commitment_signed {
22642264 Ok(commitment_signed) => {
22652265 self.context.funding_transaction = Some(signing_session.unsigned_tx.build_unsigned_tx());
@@ -3424,14 +3424,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
34243424 !self.channel_state.is_pre_funded_state() &&
34253425 !matches!(self.channel_state, ChannelState::AwaitingChannelReady(flags) if flags.is_set(AwaitingChannelReadyFlags::WAITING_FOR_BATCH))
34263426 }
3427- }
34283427
3429- impl<C, F, SP: Deref> ScopedChannelContext<C, F, SP>
3430- where
3431- C: Deref<Target = ChannelContext<SP>>,
3432- F: Deref<Target = FundingScope>,
3433- SP::Target: SignerProvider,
3434- {
34353428 /// Transaction nomenclature is somewhat confusing here as there are many different cases - a
34363429 /// transaction is referred to as "a's transaction" implying that a will be able to broadcast
34373430 /// the transaction. Thus, b will generally be sending a signature over such a transaction to
@@ -3602,7 +3595,7 @@ where
36023595 // AwaitingRemoteRevokeToRemove or AwaitingRemovedRemoteRevoke) we may have allowed them to
36033596 // "violate" their reserve value by couting those against it. Thus, we have to convert
36043597 // everything to i64 before subtracting as otherwise we can overflow.
3605- let value_to_remote_msat: i64 = (self.channel_value_satoshis() * 1000) as i64 - (self.value_to_self_msat as i64) - (remote_htlc_total_msat as i64) - value_to_self_msat_offset;
3598+ let value_to_remote_msat: i64 = (self.channel_value_satoshis * 1000) as i64 - (self.value_to_self_msat as i64) - (remote_htlc_total_msat as i64) - value_to_self_msat_offset;
36063599 assert!(value_to_remote_msat >= 0);
36073600
36083601 #[cfg(debug_assertions)]
@@ -3680,9 +3673,7 @@ where
36803673 outbound_htlc_preimages,
36813674 }
36823675 }
3683- }
36843676
3685- impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
36863677 #[inline]
36873678 /// Creates a set of keys for build_commitment_transaction to generate a transaction which our
36883679 /// counterparty will sign (ie DO NOT send signatures over a transaction created by this to
@@ -4519,14 +4510,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
45194510 msg_name);
45204511 }
45214512 }
4522- }
45234513
4524- impl<C, F, SP: Deref> ScopedChannelContext<C, F, SP>
4525- where
4526- C: Deref<Target = ChannelContext<SP>>,
4527- F: Deref<Target = FundingScope>,
4528- SP::Target: SignerProvider,
4529- {
45304514 fn get_initial_counterparty_commitment_signature<L: Deref>(
45314515 &self, logger: &L
45324516 ) -> Result<Signature, ChannelError>
@@ -4553,14 +4537,7 @@ where
45534537 _ => todo!(),
45544538 }
45554539 }
4556- }
45574540
4558- impl<C, F, SP: Deref> ScopedChannelContext<C, F, SP>
4559- where
4560- C: DerefMut<Target = ChannelContext<SP>>,
4561- F: DerefMut<Target = FundingScope>,
4562- SP::Target: SignerProvider,
4563- {
45644541 fn get_initial_commitment_signed<L: Deref>(
45654542 &mut self, logger: &L
45664543 ) -> Result<msgs::CommitmentSigned, ChannelError>
@@ -5550,8 +5527,7 @@ impl<SP: Deref> FundedChannel<SP> where
55505527
55515528 let keys = self.context.build_holder_transaction_keys(self.holder_commitment_point.current_point());
55525529
5553- let funding_context = self.context();
5554- let commitment_stats = funding_context.build_commitment_transaction(self.holder_commitment_point.transaction_number(), &keys, true, false, logger);
5530+ let commitment_stats = self.context.build_commitment_transaction(self.holder_commitment_point.transaction_number(), &keys, true, false, logger);
55555531 let commitment_txid = {
55565532 let trusted_tx = commitment_stats.tx.trust();
55575533 let bitcoin_tx = trusted_tx.built_transaction();
@@ -6303,8 +6279,7 @@ impl<SP: Deref> FundedChannel<SP> where
63036279 let dust_exposure_limiting_feerate = self.context.get_dust_exposure_limiting_feerate(&fee_estimator);
63046280 let htlc_stats = self.context.get_pending_htlc_stats(Some(feerate_per_kw), dust_exposure_limiting_feerate);
63056281 let keys = self.context.build_holder_transaction_keys(self.holder_commitment_point.current_point());
6306- let funding_context = self.context();
6307- let commitment_stats = funding_context.build_commitment_transaction(self.holder_commitment_point.transaction_number(), &keys, true, true, logger);
6282+ let commitment_stats = self.context.build_commitment_transaction(self.holder_commitment_point.transaction_number(), &keys, true, true, logger);
63086283 let buffer_fee_msat = commit_tx_fee_sat(feerate_per_kw, commitment_stats.num_nondust_htlcs + htlc_stats.on_holder_tx_outbound_holding_cell_htlcs_count as usize + CONCURRENT_INBOUND_HTLC_FEE_BUFFER as usize, self.context.get_channel_type()) * 1000;
63096284 let holder_balance_msat = commitment_stats.local_balance_msat - htlc_stats.outbound_holding_cell_msat;
63106285 if holder_balance_msat < buffer_fee_msat + self.context.counterparty_selected_channel_reserve_satoshis.unwrap() * 1000 {
@@ -6605,7 +6580,7 @@ impl<SP: Deref> FundedChannel<SP> where
66056580 }
66066581 let funding_signed = if self.context.signer_pending_funding && !self.context.is_outbound() {
66076582 let counterparty_keys = self.context.build_remote_transaction_keys();
6608- let counterparty_initial_commitment_tx = self.context() .build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number + 1, &counterparty_keys, false, false, logger).tx;
6583+ let counterparty_initial_commitment_tx = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number + 1, &counterparty_keys, false, false, logger).tx;
66096584 self.context.get_funding_signed_msg(logger, counterparty_initial_commitment_tx)
66106585 } else { None };
66116586 // Provide a `channel_ready` message if we need to, but only if we're _not_ still pending
@@ -8531,8 +8506,7 @@ impl<SP: Deref> FundedChannel<SP> where
85318506 where L::Target: Logger
85328507 {
85338508 let counterparty_keys = self.context.build_remote_transaction_keys();
8534- let funding_context = self.context();
8535- let commitment_stats = funding_context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, true, logger);
8509+ let commitment_stats = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, true, logger);
85368510 let counterparty_commitment_tx = commitment_stats.tx;
85378511
85388512 #[cfg(any(test, fuzzing))]
@@ -8564,8 +8538,7 @@ impl<SP: Deref> FundedChannel<SP> where
85648538 self.build_commitment_no_state_update(logger);
85658539
85668540 let counterparty_keys = self.context.build_remote_transaction_keys();
8567- let funding_context = self.context();
8568- let commitment_stats = funding_context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, true, logger);
8541+ let commitment_stats = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, true, logger);
85698542 let counterparty_commitment_txid = commitment_stats.tx.trust().txid();
85708543
85718544 match &self.context.holder_signer {
@@ -8842,7 +8815,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
88428815 /// Only allowed after [`ChannelContext::channel_transaction_parameters`] is set.
88438816 fn get_funding_created_msg<L: Deref>(&mut self, logger: &L) -> Option<msgs::FundingCreated> where L::Target: Logger {
88448817 let counterparty_keys = self.context.build_remote_transaction_keys();
8845- let counterparty_initial_commitment_tx = self.context() .build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, false, logger).tx;
8818+ let counterparty_initial_commitment_tx = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, false, logger).tx;
88468819 let signature = match &self.context.holder_signer {
88478820 // TODO (taproot|arik): move match into calling method for Taproot
88488821 ChannelSignerType::Ecdsa(ecdsa) => {
0 commit comments