Make sure case with only one value in scriptSig as P2SH ONLY applies if the script is P2WPKH or P2WSH

This commit is contained in:
Thomas Kerin 2017-01-03 20:15:28 +01:00 committed by Daniel Cousens
parent 1d168592a3
commit e4db4a07b0

View file

@ -21,8 +21,8 @@ function check (script, allowIncomplete) {
var inputType = bscript.classifyInput(scriptSigChunks, allowIncomplete)
var outputType = bscript.classifyOutput(redeemScriptChunks)
if (chunks.length === 1 && (outputType === bscript.types.P2WSH || outputType === bscript.types.P2WPKH)) {
return true
if (chunks.length === 1) {
return outputType === bscript.types.P2WSH || outputType === bscript.types.P2WPKH
}
return inputType === outputType