Add witness is true to signing

This commit is contained in:
junderw 2017-08-28 18:19:44 +09:00 committed by Daniel Cousens
parent f7d33c5357
commit 1495384862

View file

@ -87,6 +87,7 @@ function expandInput (scriptSig, witnessStack) {
witnessScript = witnessStack[witnessStack.length - 1]
witnessScriptType = bscript.classifyOutput(witnessScript)
p2wsh = true
witness = true
if (scriptSig.length === 0) {
prevOutScript = bscript.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))
prevOutType = scriptTypes.P2WSH
@ -112,6 +113,7 @@ function expandInput (scriptSig, witnessStack) {
scriptType = witnessScriptType
chunks = witnessStack.slice(0, -1)
} else if (classifyWitness === scriptTypes.P2WPKH) {
witness = true
var key = witnessStack[witnessStack.length - 1]
var keyHash = bcrypto.hash160(key)
if (scriptSig.length === 0) {