btcs

bitcoin script parser/evaluator/compiler/decompiler
git clone git://jb55.com/btcs
Log | Files | Refs | README | LICENSE

commit f5e45a7d0a6a0e3ffc6b5bb32559d1e80fc9ab6c
parent 743e16de217c5a621c6c76e89175edeb09797da1
Author: William Casarin <jb55@jb55.com>
Date:   Wed, 25 Oct 2017 19:29:49 -0700

script: fix nip bug

due to buggy erase which I shouldn't use...

Diffstat:
Mscript.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/script.c b/script.c @@ -252,7 +252,8 @@ script_eval(struct stack *script, struct stack *stack) { if (stack_size(stack) < 2) return script_add_error("SCRIPT_ERR_INVALID_STACK_OPERATION"); // TODO: sanity check - stack_size() == stack_end(stack) - stack_erase(stack, stack_size(stack) - 2); + stack_set_val(stack, -2, stack_top_val(stack, -1)); + stack_pop(stack); } break;