Skip to content

Commit 1495384

Browse files
junderwdcousens
authored andcommitted
Add witness is true to signing
1 parent f7d33c5 commit 1495384

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/transaction_builder.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ function expandInput (scriptSig, witnessStack) {
8787
witnessScript = witnessStack[witnessStack.length - 1]
8888
witnessScriptType = bscript.classifyOutput(witnessScript)
8989
p2wsh = true
90+
witness = true
9091
if (scriptSig.length === 0) {
9192
prevOutScript = bscript.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))
9293
prevOutType = scriptTypes.P2WSH
@@ -112,6 +113,7 @@ function expandInput (scriptSig, witnessStack) {
112113
scriptType = witnessScriptType
113114
chunks = witnessStack.slice(0, -1)
114115
} else if (classifyWitness === scriptTypes.P2WPKH) {
116+
witness = true
115117
var key = witnessStack[witnessStack.length - 1]
116118
var keyHash = bcrypto.hash160(key)
117119
if (scriptSig.length === 0) {

0 commit comments

Comments
 (0)