Browse Source

Add witness is true to signing

hk-custom-address
junderw 8 years ago
committed by Daniel Cousens
parent
commit
1495384862
  1. 2
      src/transaction_builder.js

2
src/transaction_builder.js

@ -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) {

Loading…
Cancel
Save