txb: do not classify blank input scripts as nonstandard

This commit is contained in:
Daniel Cousens 2017-07-13 11:27:59 +10:00 committed by Daniel Cousens
parent 22ab90dee3
commit 1d6b978aff
2 changed files with 25 additions and 2 deletions

View file

@ -47,6 +47,8 @@ function extractChunks (type, chunks, script) {
}
}
function expandInput (scriptSig, witnessStack) {
if (scriptSig.length === 0 && witnessStack.length === 0) return {}
var prevOutScript
var prevOutType
var scriptType
@ -546,7 +548,7 @@ TransactionBuilder.prototype.__addInputUnsafe = function (txHash, vout, options)
// derive what we can from the scriptSig
if (options.script !== undefined) {
input = expandInput(options.script, options.witness)
input = expandInput(options.script, options.witness || [])
}
// if an input value was given, retain it