TxBuilder: avoid unnecessary assertion, already done in classification
This commit is contained in:
parent
e33a6409d3
commit
c7c58307f0
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue