txscript/engine: Use optimized isScriptHashScript

This commit is contained in:
Conner Fromknecht 2019-04-19 00:49:23 -07:00 committed by Olaoluwa Osuntokun
parent a59e01c23c
commit 1be3450efb
No known key found for this signature in database
GPG key ID: 3BBD59E99B280306

View file

@ -944,7 +944,7 @@ func NewEngine(scriptPubKey []byte, tx *wire.MsgTx, txIdx int, flags ScriptFlags
vm.scriptIdx++
}
if vm.hasFlag(ScriptBip16) && isScriptHash(vm.scripts[1]) {
if vm.hasFlag(ScriptBip16) && isScriptHashScript(scriptPubKey) {
// Only accept input scripts that push data for P2SH.
// Notice that the push only checks have already been done when
// the flag to verify signature scripts are push only is set