txscript/engine: Use optimized IsPushOnlyScript

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

View file

@ -950,7 +950,7 @@ func NewEngine(scriptPubKey []byte, tx *wire.MsgTx, txIdx int, flags ScriptFlags
// the flag to verify signature scripts are push only is set
// above, so avoid checking again.
alreadyChecked := vm.hasFlag(ScriptVerifySigPushOnly)
if !alreadyChecked && !isPushOnly(vm.scripts[0]) {
if !alreadyChecked && !IsPushOnlyScript(scriptSig) {
return nil, scriptError(ErrNotPushOnly,
"pay to script hash is not push only")
}