diff options
author | Gregory Sanders <gsanders87@gmail.com> | 2018-03-07 10:49:28 -0500 |
---|---|---|
committer | Gregory Sanders <gsanders87@gmail.com> | 2018-03-07 10:57:00 -0500 |
commit | 0749808a7fc31250abfbc8c61963065e0d320824 (patch) | |
tree | 2867a7696d0b0c8f5780b3b3bb65369de7d7db58 /src/script/interpreter.cpp | |
parent | 176db6147421c3888076ab8be762a23d9b1bc0c5 (diff) |
CheckMinimalPush comments are prescriptive
Diffstat (limited to 'src/script/interpreter.cpp')
-rw-r--r-- | src/script/interpreter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 9401442f4d..d56bac7316 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -223,22 +223,22 @@ bool static CheckMinimalPush(const valtype& data, opcodetype opcode) { // Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal assert(0 <= opcode && opcode <= OP_PUSHDATA4); if (data.size() == 0) { - // Could have used OP_0. + // Should have used OP_0. return opcode == OP_0; } else if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) { - // Could have used OP_1 .. OP_16. + // Should have used OP_1 .. OP_16. return false; } else if (data.size() == 1 && data[0] == 0x81) { - // Could have used OP_1NEGATE. + // Should have used OP_1NEGATE. return false; } else if (data.size() <= 75) { - // Could have used a direct push (opcode indicating number of bytes pushed + those bytes). + // Must have used a direct push (opcode indicating number of bytes pushed + those bytes). return opcode == data.size(); } else if (data.size() <= 255) { - // Could have used OP_PUSHDATA. + // Must have used OP_PUSHDATA. return opcode == OP_PUSHDATA1; } else if (data.size() <= 65535) { - // Could have used OP_PUSHDATA2. + // Must have used OP_PUSHDATA2. return opcode == OP_PUSHDATA2; } return true; |