script: improve isCode.
This commit is contained in:
parent
47eb484657
commit
7145d21c9c
@ -1397,8 +1397,8 @@ Script.prototype.indexOf = function indexOf(data) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Test a script to see if it is valid
|
||||
* script code (no non-existent opcodes).
|
||||
* Test a script to see if it is likely
|
||||
* to be script code (no weird opcodes).
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
|
||||
@ -1407,7 +1407,22 @@ Script.prototype.isCode = function isCode() {
|
||||
if (op.value === -1)
|
||||
return false;
|
||||
|
||||
if (op.value > opcodes.OP_NOP10)
|
||||
if (op.isDisabled())
|
||||
return false;
|
||||
|
||||
switch (op.value) {
|
||||
case opcodes.OP_RESERVED:
|
||||
case opcodes.OP_NOP:
|
||||
case opcodes.OP_VER:
|
||||
case opcodes.OP_VERIF:
|
||||
case opcodes.OP_VERNOTIF:
|
||||
case opcodes.OP_RESERVED1:
|
||||
case opcodes.OP_RESERVED2:
|
||||
case opcodes.OP_NOP1:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (op.value > opcodes.OP_NOP3)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user