put isBadPush in execute.
This commit is contained in:
parent
1d8a86838d
commit
1168f55cef
@ -1046,6 +1046,9 @@ Script.prototype.execute = function execute(stack, flags, tx, index, version) {
|
|||||||
for (ip = 0; ip < this.code.length; ip++) {
|
for (ip = 0; ip < this.code.length; ip++) {
|
||||||
op = this.code[ip];
|
op = this.code[ip];
|
||||||
|
|
||||||
|
if (Script.isBadPush(op))
|
||||||
|
throw new ScriptError('BAD_OPCODE', op, ip);
|
||||||
|
|
||||||
if (Buffer.isBuffer(op)) {
|
if (Buffer.isBuffer(op)) {
|
||||||
if (op.length > constants.script.MAX_PUSH)
|
if (op.length > constants.script.MAX_PUSH)
|
||||||
throw new ScriptError('PUSH_SIZE', op, ip);
|
throw new ScriptError('PUSH_SIZE', op, ip);
|
||||||
@ -1979,17 +1982,17 @@ Script.array = function(value) {
|
|||||||
|
|
||||||
Script.prototype.removeData = function removeData(data) {
|
Script.prototype.removeData = function removeData(data) {
|
||||||
var total = 0;
|
var total = 0;
|
||||||
var op = data.op;
|
var op, sig, raw, i, a, b;
|
||||||
var sig, raw, i, a, b;
|
|
||||||
|
|
||||||
if (!this.raw)
|
if (!this.raw)
|
||||||
return this.removeDataFast(data);
|
return this.removeDataFast(data);
|
||||||
|
|
||||||
// We need to reserialize
|
// We need to reserialize
|
||||||
// the signature as minimaldata.
|
// the signature as minimaldata.
|
||||||
|
op = data.op;
|
||||||
delete data.op;
|
delete data.op;
|
||||||
sig = new Script([data]).encode();
|
sig = Script.encode([data]);
|
||||||
if (op)
|
if (op != null)
|
||||||
utils.hidden(data, 'op', op);
|
utils.hidden(data, 'op', op);
|
||||||
|
|
||||||
raw = this.encode();
|
raw = this.encode();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user