txscript: Optimize typeOfScript pay-to-pubkey-hash.
This continues the process of converting the typeOfScript function to use a combination of raw script analysis and the new tokenizer instead of the far less efficient parsed opcodes. In particular, it converts the detection of pay-to-pubkey-hash scripts to use raw script analysis.
This commit is contained in:
parent
cb4018a1d4
commit
c52f41a5af
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue