aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_tests.cpp
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2014-03-12 20:07:51 -0400
committerPeter Todd <pete@petertodd.org>2014-03-12 20:14:01 -0400
commitb41e5947735097d12eb795f2d1dc9c79ff391aba (patch)
tree4572d19728ecae595062d871d31c1f39275f6f85 /src/test/script_tests.cpp
parentca0b8acbf38a02f39e313a1c633d577f9bf7d983 (diff)
downloadbitcoin-b41e5947735097d12eb795f2d1dc9c79ff391aba.tar.xz
Fix script test handling of empty scripts
Previously an empty script would evaluate to OP_0
Diffstat (limited to 'src/test/script_tests.cpp')
-rw-r--r--src/test/script_tests.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
index dd1b613047..f9ca65653b 100644
--- a/src/test/script_tests.cpp
+++ b/src/test/script_tests.cpp
@@ -63,7 +63,11 @@ ParseScript(string s)
BOOST_FOREACH(string w, words)
{
- if (all(w, is_digit()) ||
+ if (w.size() == 0)
+ {
+ // Empty string, ignore. (boost::split given '' will return one word)
+ }
+ else if (all(w, is_digit()) ||
(starts_with(w, "-") && all(string(w.begin()+1, w.end()), is_digit())))
{
// Number