From 17082ec7d8b47b2680b9d1f21f941f1aa58b605c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 26 Oct 2022 20:46:34 +0000 Subject: [PATCH] Drop useless `mut` in `KeysInterface::sign_holder_anchor_input` The `Transaction` is not modified so there's no reason to make the reference `mut` --- lightning/src/chain/keysinterface.rs | 4 ++-- lightning/src/util/enforcing_trait_impls.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index e3108fd54..b12eee017 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -352,7 +352,7 @@ pub trait BaseSign { /// Computes the signature for a commitment transaction's anchor output used as an /// input within `anchor_tx`, which spends the commitment transaction, at index `input`. fn sign_holder_anchor_input( - &self, anchor_tx: &mut Transaction, input: usize, secp_ctx: &Secp256k1, + &self, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1, ) -> Result; /// Signs a channel announcement message with our funding key and our node secret key (aka @@ -790,7 +790,7 @@ impl BaseSign for InMemorySigner { } fn sign_holder_anchor_input( - &self, anchor_tx: &mut Transaction, input: usize, secp_ctx: &Secp256k1, + &self, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1, ) -> Result { let witness_script = chan_utils::get_anchor_redeemscript(&self.holder_channel_pubkeys.funding_pubkey); let sighash = sighash::SighashCache::new(&*anchor_tx).segwit_signature_hash( diff --git a/lightning/src/util/enforcing_trait_impls.rs b/lightning/src/util/enforcing_trait_impls.rs index 8344f9f35..6317b43d5 100644 --- a/lightning/src/util/enforcing_trait_impls.rs +++ b/lightning/src/util/enforcing_trait_impls.rs @@ -201,7 +201,7 @@ impl BaseSign for EnforcingSigner { } fn sign_holder_anchor_input( - &self, anchor_tx: &mut Transaction, input: usize, secp_ctx: &Secp256k1, + &self, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1, ) -> Result { debug_assert!(MIN_CHAN_DUST_LIMIT_SATOSHIS > ANCHOR_OUTPUT_VALUE_SATOSHI); // As long as our minimum dust limit is enforced and is greater than our anchor output -- 2.39.5