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