1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 #ifndef BITCOIN_SCRIPT_SCRIPT_ERROR_H
7 #define BITCOIN_SCRIPT_SCRIPT_ERROR_H
9 typedef enum ScriptError_t
12 SCRIPT_ERR_UNKNOWN_ERROR
,
13 SCRIPT_ERR_EVAL_FALSE
,
17 SCRIPT_ERR_SCRIPT_SIZE
,
20 SCRIPT_ERR_STACK_SIZE
,
22 SCRIPT_ERR_PUBKEY_COUNT
,
24 /* Failed verify operations */
26 SCRIPT_ERR_EQUALVERIFY
,
27 SCRIPT_ERR_CHECKMULTISIGVERIFY
,
28 SCRIPT_ERR_CHECKSIGVERIFY
,
29 SCRIPT_ERR_NUMEQUALVERIFY
,
31 /* Logical/Format/Canonical errors */
32 SCRIPT_ERR_BAD_OPCODE
,
33 SCRIPT_ERR_DISABLED_OPCODE
,
34 SCRIPT_ERR_INVALID_STACK_OPERATION
,
35 SCRIPT_ERR_INVALID_ALTSTACK_OPERATION
,
36 SCRIPT_ERR_UNBALANCED_CONDITIONAL
,
38 /* CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY */
39 SCRIPT_ERR_NEGATIVE_LOCKTIME
,
40 SCRIPT_ERR_UNSATISFIED_LOCKTIME
,
43 SCRIPT_ERR_SIG_HASHTYPE
,
45 SCRIPT_ERR_MINIMALDATA
,
46 SCRIPT_ERR_SIG_PUSHONLY
,
47 SCRIPT_ERR_SIG_HIGH_S
,
48 SCRIPT_ERR_SIG_NULLDUMMY
,
49 SCRIPT_ERR_PUBKEYTYPE
,
50 SCRIPT_ERR_CLEANSTACK
,
52 SCRIPT_ERR_SIG_NULLFAIL
,
54 /* softfork safeness */
55 SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS
,
56 SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM
,
58 /* segregated witness */
59 SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH
,
60 SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY
,
61 SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH
,
62 SCRIPT_ERR_WITNESS_MALLEATED
,
63 SCRIPT_ERR_WITNESS_MALLEATED_P2SH
,
64 SCRIPT_ERR_WITNESS_UNEXPECTED
,
65 SCRIPT_ERR_WITNESS_PUBKEYTYPE
,
67 SCRIPT_ERR_ERROR_COUNT
70 #define SCRIPT_ERR_LAST SCRIPT_ERR_ERROR_COUNT
72 const char* ScriptErrorString(const ScriptError error
);
74 #endif // BITCOIN_SCRIPT_SCRIPT_ERROR_H