Bitcoin ABC 0.32.4
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#include <string>
10
11enum class ScriptError {
12 OK = 0,
13 UNKNOWN,
16
17 /* Max sizes */
25
26 /* Operands checks */
33
34 /* Failed verify operations */
35 VERIFY,
41
42 /* Logical/Format/Canonical errors */
48
49 /* Divisor errors */
52
53 /* Bitfield errors */
56
57 /* CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY */
60
61 /* Malleability */
63 SIG_DER,
71
72 /* Schnorr */
75
76 /* softfork safeness */
78
79 /* anti replay */
82
83 /* Auxiliary errors (unused by interpreter) */
85
87};
88
89#define SCRIPT_ERR_LAST ScriptError::ERROR_COUNT
90
91std::string ScriptErrorString(const ScriptError error);
92
93namespace {
94
95inline bool set_success(ScriptError *ret) {
96 if (ret) {
97 *ret = ScriptError::OK;
98 }
99 return true;
100}
101
102inline bool set_error(ScriptError *ret, const ScriptError serror) {
103 if (ret) {
104 *ret = serror;
105 }
106 return false;
107}
108
109} // namespace
110
111#endif // BITCOIN_SCRIPT_SCRIPT_ERROR_H
#define SIG_COUNT
Definition: tests_impl.h:38
@ OP_RETURN
Definition: script.h:88
ScriptError
Definition: script_error.h:11
@ DISCOURAGE_UPGRADABLE_NOPS
@ INVALID_ALTSTACK_OPERATION
@ UNSATISFIED_LOCKTIME
@ INVALID_BITFIELD_SIZE
@ SIGCHECKS_LIMIT_EXCEEDED
@ INVALID_OPERAND_SIZE
@ INVALID_STACK_OPERATION
@ BAD_INTEGER_ENCODING
@ UNBALANCED_CONDITIONAL
std::string ScriptErrorString(const ScriptError error)