diff --git a/bitcoin/src/hash_types.rs b/bitcoin/src/hash_types.rs index b8b28cce..edcbd98a 100644 --- a/bitcoin/src/hash_types.rs +++ b/bitcoin/src/hash_types.rs @@ -69,7 +69,6 @@ See [`hashes::Hash::DISPLAY_BACKWARD`] for more details. impl_hashencode!(Txid); impl_hashencode!(Wtxid); impl_hashencode!(BlockHash); - impl_hashencode!(Sighash); impl_hashencode!(TxMerkleNode); impl_hashencode!(WitnessMerkleNode); diff --git a/bitcoin/src/sighash.rs b/bitcoin/src/sighash.rs index 27495279..961ba497 100644 --- a/bitcoin/src/sighash.rs +++ b/bitcoin/src/sighash.rs @@ -729,9 +729,10 @@ impl> SighashCache { } else if sighash == EcdsaSighashType::Single && input_index < self.tx.output.len() { let mut single_enc = Sighash::engine(); self.tx.output[input_index].consensus_encode(&mut single_enc)?; - Sighash::from_engine(single_enc).consensus_encode(&mut writer)?; + let hash = Sighash::from_engine(single_enc); + writer.write_all(&hash[..])?; } else { - zero_hash.consensus_encode(&mut writer)?; + writer.write_all(&zero_hash[..])?; } self.tx.lock_time.consensus_encode(&mut writer)?;