diff --git a/txscript/standard.go b/txscript/standard.go index d2aa0e99..08c6054e 100644 --- a/txscript/standard.go +++ b/txscript/standard.go @@ -464,6 +464,8 @@ func typeOfScript(scriptVersion uint16, script []byte) ScriptClass { switch { case isPubKeyScript(script): return PubKeyTy + case isPubKeyHashScript(script): + return PubKeyHashTy case isScriptHashScript(script): return ScriptHashTy case isMultisigScript(scriptVersion, script): @@ -475,9 +477,7 @@ func typeOfScript(scriptVersion uint16, script []byte) ScriptClass { return NonStandardTy } - if isPubkeyHash(pops) { - return PubKeyHashTy - } else if isWitnessPubKeyHash(pops) { + if isWitnessPubKeyHash(pops) { return WitnessV0PubKeyHashTy } else if isWitnessScriptHash(pops) { return WitnessV0ScriptHashTy