aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_tests.cpp
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2013-08-25 12:37:07 -0400
committerPeter Todd <pete@petertodd.org>2013-08-25 12:37:07 -0400
commit214d45b6b9a4f25d7d8bd4e5443fa2bee485353a (patch)
tree8926dc1356e45bcef9a38813c7cf0dc6148bb16c /src/test/script_tests.cpp
parente9e2ef5fbd610fbaa3801440254c39ac4ba8f91d (diff)
downloadbitcoin-214d45b6b9a4f25d7d8bd4e5443fa2bee485353a.tar.xz
Document and test OP_RESERVED weirdness
Seems it was forgotten about when IsPushOnly() and the unittests were written. A particular oddity is that OP_RESERVED doesn't count towards the >201 opcode limit unlike every other named opcode.
Diffstat (limited to 'src/test/script_tests.cpp')
-rw-r--r--src/test/script_tests.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
index e7ad52627c..c1f6f178db 100644
--- a/src/test/script_tests.cpp
+++ b/src/test/script_tests.cpp
@@ -32,8 +32,12 @@ ParseScript(string s)
if (mapOpNames.size() == 0)
{
- for (int op = OP_NOP; op <= OP_NOP10; op++)
+ for (int op = 0; op <= OP_NOP10; op++)
{
+ // Allow OP_RESERVED to get into mapOpNames
+ if (op < OP_NOP && op != OP_RESERVED)
+ continue;
+
const char* name = GetOpName((opcodetype)op);
if (strcmp(name, "OP_UNKNOWN") == 0)
continue;
@@ -72,7 +76,7 @@ ParseScript(string s)
}
else if (mapOpNames.count(w))
{
- // opcode, e.g. OP_ADD or OP_1:
+ // opcode, e.g. OP_ADD or ADD:
result << mapOpNames[w];
}
else