TxBuilder: avoid unnecessary assertion, already done in classification

This commit is contained in:
Daniel Cousens 2015-02-05 13:29:28 +11:00
parent e33a6409d3
commit c7c58307f0

View file

@ -20,14 +20,13 @@ function extractInput(txIn) {
var prevOutType = scripts.classifyInput(scriptSig, true)
var scriptType
// Re-classify if P2SH
// Re-classify if scriptHash
if (prevOutType === 'scripthash') {
redeemScript = Script.fromBuffer(scriptSig.chunks.slice(-1)[0])
prevOutScript = scripts.scriptHashOutput(redeemScript.getHash())
scriptSig = Script.fromChunks(scriptSig.chunks.slice(0, -1))
scriptType = scripts.classifyInput(scriptSig, true)
assert.equal(scripts.classifyOutput(redeemScript), scriptType, 'Non-matching scriptSig and scriptPubKey in input')
} else {
scriptType = prevOutType