From: Matt Corallo Date: Wed, 26 Oct 2022 20:46:34 +0000 (+0000) Subject: Drop useless `mut` in `KeysInterface::sign_holder_anchor_input` X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2022-10-112-bindings-init;p=rust-lightning Drop useless `mut` in `KeysInterface::sign_holder_anchor_input` The `Transaction` is not modified so there's no reason to make the reference `mut` --- 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