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.
This commit is contained in:
Peter Todd
2013-08-25 12:37:07 -04:00
parent e9e2ef5fbd
commit 214d45b6b9
5 changed files with 18 additions and 3 deletions

View File

@@ -543,6 +543,10 @@ public:
opcodetype opcode;
if (!GetOp(pc, opcode))
return false;
// Note that IsPushOnly() *does* consider OP_RESERVED to be a
// push-type opcode, however execution of OP_RESERVED fails, so
// it's not relevant to P2SH as the scriptSig would fail prior to
// the P2SH special validation code being executed.
if (opcode > OP_16)
return false;
}