txscript: Optimize typeOfScript multisig.
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, for this commit, since the ability to detect multisig scripts via the new tokenizer is now available, the function is simply updated to make use of it.
This commit is contained in:
parent
c85458bc7c
commit
cfb6bc9399
1 changed files with 2 additions and 2 deletions
|
@ -509,6 +509,8 @@ func typeOfScript(scriptVersion uint16, script []byte) ScriptClass {
|
|||
switch {
|
||||
case isScriptHashScript(script):
|
||||
return ScriptHashTy
|
||||
case isMultisigScript(scriptVersion, script):
|
||||
return MultiSigTy
|
||||
}
|
||||
|
||||
pops, err := parseScript(script)
|
||||
|
@ -524,8 +526,6 @@ func typeOfScript(scriptVersion uint16, script []byte) ScriptClass {
|
|||
return WitnessV0PubKeyHashTy
|
||||
} else if isWitnessScriptHash(pops) {
|
||||
return WitnessV0ScriptHashTy
|
||||
} else if isMultiSig(pops) {
|
||||
return MultiSigTy
|
||||
} else if isNullData(pops) {
|
||||
return NullDataTy
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue