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
671b5fefef
commit
71bf51e82c
1 changed files with 2 additions and 2 deletions
|
@ -509,6 +509,8 @@ func typeOfScript(scriptVersion uint16, script []byte) ScriptClass {
|
||||||
switch {
|
switch {
|
||||||
case isScriptHashScript(script):
|
case isScriptHashScript(script):
|
||||||
return ScriptHashTy
|
return ScriptHashTy
|
||||||
|
case isMultisigScript(scriptVersion, script):
|
||||||
|
return MultiSigTy
|
||||||
}
|
}
|
||||||
|
|
||||||
pops, err := parseScript(script)
|
pops, err := parseScript(script)
|
||||||
|
@ -524,8 +526,6 @@ func typeOfScript(scriptVersion uint16, script []byte) ScriptClass {
|
||||||
return WitnessV0PubKeyHashTy
|
return WitnessV0PubKeyHashTy
|
||||||
} else if isWitnessScriptHash(pops) {
|
} else if isWitnessScriptHash(pops) {
|
||||||
return WitnessV0ScriptHashTy
|
return WitnessV0ScriptHashTy
|
||||||
} else if isMultiSig(pops) {
|
|
||||||
return MultiSigTy
|
|
||||||
} else if isNullData(pops) {
|
} else if isNullData(pops) {
|
||||||
return NullDataTy
|
return NullDataTy
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue