refactor script.execute order of opcodes.

This commit is contained in:
Christopher Jeffrey 2015-12-09 12:00:35 -08:00
parent e605fe5388
commit d45350ede9

View File

@ -217,18 +217,6 @@ script.execute = function execute(s, stack, tx, index) {
case 'endif': {
return false;
}
case 'dup': {
if (stack.length === 0)
return false;
stack.push(stack[stack.length - 1]);
break;
}
case 'drop': {
if (stack.length === 0)
return false;
stack.pop();
break;
}
case 'nop1':
case 'nop3':
case 'nop4':
@ -238,7 +226,6 @@ script.execute = function execute(s, stack, tx, index) {
case 'nop8':
case 'nop9':
case 'nop10': {
;
// OP_EVAL
// if (o === 'nop1') {
// var evalScript = script.decode(stack.pop());
@ -283,6 +270,18 @@ script.execute = function execute(s, stack, tx, index) {
stack.push(new bn(stack.length).toArray());
break;
}
case 'drop': {
if (stack.length === 0)
return false;
stack.pop();
break;
}
case 'dup': {
if (stack.length === 0)
return false;
stack.push(stack[stack.length - 1]);
break;
}
case 'nip': {
if (stack.length < 2)
return false;