]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Move `hash_to_message` to variable
authorElias Rohrer <dev@tnull.de>
Wed, 27 Mar 2024 10:53:33 +0000 (11:53 +0100)
committerElias Rohrer <dev@tnull.de>
Tue, 9 Apr 2024 11:08:25 +0000 (13:08 +0200)
lightning/src/sign/mod.rs

index fd992a594c489fe2e6ada0491f1cdc3c5fe8d0e9..e7cee4701236f38bb6c114f55544975635109bd2 100644 (file)
@@ -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<secp256k1::All>) -> Result<Signature, ()> {