fix witness error type.
This commit is contained in:
parent
6a482af6d0
commit
81c8eb5f5b
@ -3883,8 +3883,11 @@ Script.verify = function verify(input, witness, output, tx, i, flags) {
|
|||||||
hadWitness = true;
|
hadWitness = true;
|
||||||
|
|
||||||
// Input script must be exactly one push of the redeem script.
|
// Input script must be exactly one push of the redeem script.
|
||||||
if (!(input.code.length === 1 && utils.equal(input.code[0], raw)))
|
if (!(input.code.length === 1
|
||||||
throw new ScriptError('WITNESS_MALLEATED');
|
&& utils.equal(input.code[0], raw)
|
||||||
|
&& Script.checkMinimal(input.code[0]))) {
|
||||||
|
throw new ScriptError('WITNESS_MALLEATED_P2SH');
|
||||||
|
}
|
||||||
|
|
||||||
// Verify the program in the redeem script
|
// Verify the program in the redeem script
|
||||||
Script.verifyProgram(witness, redeem, flags, tx, i);
|
Script.verifyProgram(witness, redeem, flags, tx, i);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user