Bitcoin ABC  0.22.13
P2P Digital Currency
script_error.h
Go to the documentation of this file.
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.
5 
6 #ifndef BITCOIN_SCRIPT_SCRIPT_ERROR_H
7 #define BITCOIN_SCRIPT_SCRIPT_ERROR_H
8 
9 enum class ScriptError {
10  OK = 0,
11  UNKNOWN,
12  EVAL_FALSE,
13  OP_RETURN,
14 
15  /* Max sizes */
17  PUSH_SIZE,
18  OP_COUNT,
19  STACK_SIZE,
20  SIG_COUNT,
23 
24  /* Operands checks */
30 
31  /* Failed verify operations */
32  VERIFY,
38 
39  /* Logical/Format/Canonical errors */
40  BAD_OPCODE,
45 
46  /* Divisor errors */
49 
50  /* Bitfield errors */
53 
54  /* CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY */
57 
58  /* Malleability */
60  SIG_DER,
63  SIG_HIGH_S,
64  PUBKEYTYPE,
65  CLEANSTACK,
66  MINIMALIF,
68 
69  /* Schnorr */
72 
73  /* softfork safeness */
75 
76  /* anti replay */
79 
80  /* Auxiliary errors (unused by interpreter) */
82 
84 };
85 
86 #define SCRIPT_ERR_LAST ScriptError::ERROR_COUNT
87 
88 const char *ScriptErrorString(const ScriptError error);
89 
90 namespace {
91 
92 inline bool set_success(ScriptError *ret) {
93  if (ret) {
94  *ret = ScriptError::OK;
95  }
96  return true;
97 }
98 
99 inline bool set_error(ScriptError *ret, const ScriptError serror) {
100  if (ret) {
101  *ret = serror;
102  }
103  return false;
104 }
105 
106 } // namespace
107 
108 #endif // BITCOIN_SCRIPT_SCRIPT_ERROR_H
const char * ScriptErrorString(const ScriptError error)
Definition: script_error.cpp:8
ScriptError
Definition: script_error.h:9
bool error(const char *fmt, const Args &... args)
Definition: system.h:47