diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index cd590470..3d42d741 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -38,7 +38,6 @@ use hashes::Hash; #[cfg(feature="bitcoinconsensus")] use OutPoint; use util::key::PublicKey; -use util::psbt::serialize::Serialize; #[derive(Clone, Default, PartialOrd, Ord, PartialEq, Eq, Hash)] /// A Bitcoin script @@ -278,12 +277,12 @@ impl Script { /// Returns 160-bit hash of the script pub fn script_hash(&self) -> ScriptHash { - ScriptHash::hash(&self.serialize()) + ScriptHash::hash(&self.as_bytes()) } /// Returns 256-bit hash of the script for P2WSH outputs pub fn wscript_hash(&self) -> WScriptHash { - WScriptHash::hash(&self.serialize()) + WScriptHash::hash(&self.as_bytes()) } /// The length in bytes of the script