Skip to content

Commit

Permalink
tapscript: update execContext with code sep opcode position
Browse files Browse the repository at this point in the history
  • Loading branch information
afk11 committed Nov 11, 2019
1 parent f6c483e commit ce8f21a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Script/Interpreter/Interpreter.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ public function evaluate(ScriptInterface $script, Stack $mainStack, int $sigVers
}
$hashStartPos = 0;
$opCount = 0;
$opCodePos = 0;
$zero = gmp_init(0, 10);
$altStack = new Stack();
$vfStack = new Stack();
Expand Down Expand Up @@ -1072,6 +1073,7 @@ public function evaluate(ScriptInterface $script, Stack $mainStack, int $sigVers

case Opcodes::OP_CODESEPARATOR:
$hashStartPos = $parser->getPosition();
$execContext->setCodeSeparatorPosition($opCodePos);
break;

case Opcodes::OP_CHECKSIGADD:
Expand Down Expand Up @@ -1231,6 +1233,8 @@ public function evaluate(ScriptInterface $script, Stack $mainStack, int $sigVers
if (count($mainStack) + count($altStack) > self::MAX_STACK_SIZE) {
throw new \RuntimeException('Invalid stack size, exceeds 1000');
}

$opCodePos++;
}
}

Expand Down

0 comments on commit ce8f21a

Please sign in to comment.