From: Elias Rohrer Date: Wed, 27 Mar 2024 10:53:33 +0000 (+0100) Subject: Move `hash_to_message` to variable X-Git-Tag: v0.0.123-beta~13^2~11 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=2690823c9d0b96b429eaef59aec4b4591d08353a;p=rust-lightning Move `hash_to_message` to variable --- diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs index fd992a594..e7cee4701 100644 --- a/lightning/src/sign/mod.rs +++ b/lightning/src/sign/mod.rs @@ -1216,7 +1216,8 @@ impl EcdsaChannelSigner for InMemorySigner { let our_htlc_private_key = chan_utils::derive_private_key( &secp_ctx, &htlc_descriptor.per_commitment_point, &self.htlc_base_key ); - Ok(sign_with_aux_rand(&secp_ctx, &hash_to_message!(sighash.as_byte_array()), &our_htlc_private_key, &self)) + let sighash = hash_to_message!(sighash.as_byte_array()); + Ok(sign_with_aux_rand(&secp_ctx, &sighash, &our_htlc_private_key, &self)) } fn sign_counterparty_htlc_transaction(&self, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey, htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1) -> Result {