diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-06-08 12:48:46 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-06-08 13:36:48 +0200 |
commit | 9c248e39f2807a7f89e555e99cc55cb2de1ad335 (patch) | |
tree | 23d98e7fdeec7350b6ff274775cce9ee91d5e13c /src/script/script.h | |
parent | 35e7f13f68f970d036606e111429ae34750c363a (diff) | |
parent | ac4e438229134595e949bfedb1f487c71fd45d24 (diff) |
Merge #10481: Decodehextx scripts sanity check
ac4e438 Sanity check transaction scripts in DecodeHexTx (Andrew Chow)
5b75c47 Add a valid opcode sanity check to CScript (Andrew Chow)
Tree-SHA512: a516e95c274c9d131123150c798cae8bed75925e8a4d59469967dd7f1d49f7f8161e26afb61024b821bd8dcdffdfd0d19b8dcad20b39b1106820326d8d56904d
Diffstat (limited to 'src/script/script.h')
-rw-r--r-- | src/script/script.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/script.h b/src/script/script.h index 95a5999a13..23706b9826 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -190,6 +190,9 @@ enum opcodetype OP_INVALIDOPCODE = 0xff, }; +// Maximum value that an opcode can be +static const unsigned int MAX_OPCODE = OP_NOP10; + const char* GetOpName(opcodetype opcode); class scriptnum_error : public std::runtime_error @@ -630,6 +633,9 @@ public: bool IsPushOnly(const_iterator pc) const; bool IsPushOnly() const; + /** Check if the script contains valid OP_CODES */ + bool HasValidOps() const; + /** * Returns whether the script is guaranteed to fail at execution, * regardless of the initial stack. This allows outputs to be pruned |