templates: push only for scriptHash inputs, fixes #705
This commit is contained in:
parent
03dc569236
commit
433d9f1b18
1 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@ function check (script, allowIncomplete) {
|
||||||
check.toJSON = function () { return 'scriptHash input' }
|
check.toJSON = function () { return 'scriptHash input' }
|
||||||
|
|
||||||
function encode (redeemScriptSig, redeemScript) {
|
function encode (redeemScriptSig, redeemScript) {
|
||||||
var scriptSigChunks = bscript.decompile(redeemScriptSig)
|
var scriptSigChunks = bscript.decompilePushOnly(redeemScriptSig)
|
||||||
var serializedScriptPubKey = bscript.compile(redeemScript)
|
var serializedScriptPubKey = bscript.compile(redeemScript)
|
||||||
|
|
||||||
return bscript.compile([].concat(
|
return bscript.compile([].concat(
|
||||||
|
@ -37,7 +37,7 @@ function decode (buffer) {
|
||||||
typeforce(check, chunks)
|
typeforce(check, chunks)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
redeemScriptSig: bscript.compile(chunks.slice(0, -1)),
|
redeemScriptSig: bscript.compilePushOnly(chunks.slice(0, -1)),
|
||||||
redeemScript: chunks[chunks.length - 1]
|
redeemScript: chunks[chunks.length - 1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue