From f8ec64d46f35d4d684b53cca7d1c69b896db8b57 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 13 Jan 2016 20:20:18 -0800 Subject: [PATCH] do not throw on empty stack. --- lib/bcoin/script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bcoin/script.js b/lib/bcoin/script.js index e9f5ac24..506fc904 100644 --- a/lib/bcoin/script.js +++ b/lib/bcoin/script.js @@ -180,8 +180,9 @@ script.verify = function verify(input, output, tx, i, flags) { // Reset the stack stack = copy; - // Stack should _never_ be empty at this point - assert(stack.length !== 0); + // Stack should not be empty at this point + if (stack.length === 0) + return false; // Grab the real redeem script redeem = stack.pop();