scripts: fix isScriptHashInput classification
This commit is contained in:
parent
ec66ca9b1a
commit
d00ec9af29
3 changed files with 7 additions and 10 deletions
src
|
@ -73,15 +73,12 @@ function isScriptHashInput (script, allowIncomplete) {
|
|||
if (!Buffer.isBuffer(lastChunk)) return false
|
||||
|
||||
var scriptSig = Script.fromChunks(script.chunks.slice(0, -1))
|
||||
var scriptPubKey
|
||||
var redeemScript = Script.fromBuffer(lastChunk)
|
||||
|
||||
try {
|
||||
scriptPubKey = Script.fromBuffer(lastChunk)
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
// is redeemScript a valid script?
|
||||
if (redeemScript.chunks.length === 0) return false
|
||||
|
||||
return classifyInput(scriptSig, allowIncomplete) === classifyOutput(scriptPubKey)
|
||||
return classifyInput(scriptSig, allowIncomplete) === classifyOutput(redeemScript)
|
||||
}
|
||||
|
||||
function isScriptHashOutput (script) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue