aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_tests.cpp
diff options
context:
space:
mode:
authorPeter Todd <[email protected]>2014-03-12 20:07:51 -0400
committerPeter Todd <[email protected]>2014-03-12 20:14:01 -0400
commitb41e5947735097d12eb795f2d1dc9c79ff391aba (patch)
tree4572d19728ecae595062d871d31c1f39275f6f85 /src/test/script_tests.cpp
parentMerge pull request #3841 from schildbach/script-tests-OP_0 (diff)
downloaddiscoin-b41e5947735097d12eb795f2d1dc9c79ff391aba.tar.xz
discoin-b41e5947735097d12eb795f2d1dc9c79ff391aba.zip
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 dd1b61304..f9ca65653 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