script: minor.

This commit is contained in:
Christopher Jeffrey 2016-10-09 08:35:18 -07:00
parent 7ce14d13fb
commit d3ac6eba9e
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -670,13 +670,13 @@ Script.prototype.execute = function execute(stack, flags, tx, index, version) {
case opcodes.OP_PICK:
case opcodes.OP_ROLL: {
if (stack.length < 2)
throw new ScriptError('INVALID_STACK_OPERATION', op);
throw new ScriptError('INVALID_STACK_OPERATION', op, ip);
num = Script.num(stack.top(-1), flags).toNumber();
stack.pop();
if (num < 0 || num >= stack.length)
throw new ScriptError('INVALID_STACK_OPERATION', op);
throw new ScriptError('INVALID_STACK_OPERATION', op, ip);
val = stack.top(-num - 1);