2014-11-01 04:29:12 +01:00
|
|
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
2014-12-17 02:47:57 +01:00
|
|
|
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
2014-11-01 04:29:12 +01:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-20 20:06:08 +01:00
|
|
|
#ifndef BITCOIN_SCRIPT_SCRIPT_ERROR_H
|
|
|
|
#define BITCOIN_SCRIPT_SCRIPT_ERROR_H
|
2014-11-01 04:29:12 +01:00
|
|
|
|
|
|
|
typedef enum ScriptError_t
|
|
|
|
{
|
|
|
|
SCRIPT_ERR_OK = 0,
|
|
|
|
SCRIPT_ERR_UNKNOWN_ERROR,
|
|
|
|
SCRIPT_ERR_EVAL_FALSE,
|
|
|
|
SCRIPT_ERR_OP_RETURN,
|
|
|
|
|
|
|
|
/* Max sizes */
|
|
|
|
SCRIPT_ERR_SCRIPT_SIZE,
|
|
|
|
SCRIPT_ERR_PUSH_SIZE,
|
|
|
|
SCRIPT_ERR_OP_COUNT,
|
|
|
|
SCRIPT_ERR_STACK_SIZE,
|
|
|
|
SCRIPT_ERR_SIG_COUNT,
|
|
|
|
SCRIPT_ERR_PUBKEY_COUNT,
|
|
|
|
|
|
|
|
/* Failed verify operations */
|
|
|
|
SCRIPT_ERR_VERIFY,
|
|
|
|
SCRIPT_ERR_EQUALVERIFY,
|
|
|
|
SCRIPT_ERR_CHECKMULTISIGVERIFY,
|
|
|
|
SCRIPT_ERR_CHECKSIGVERIFY,
|
|
|
|
SCRIPT_ERR_NUMEQUALVERIFY,
|
|
|
|
|
|
|
|
/* Logical/Format/Canonical errors */
|
|
|
|
SCRIPT_ERR_BAD_OPCODE,
|
|
|
|
SCRIPT_ERR_DISABLED_OPCODE,
|
|
|
|
SCRIPT_ERR_INVALID_STACK_OPERATION,
|
|
|
|
SCRIPT_ERR_INVALID_ALTSTACK_OPERATION,
|
|
|
|
SCRIPT_ERR_UNBALANCED_CONDITIONAL,
|
|
|
|
|
2015-09-26 01:18:51 +02:00
|
|
|
/* CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY */
|
2014-09-29 09:44:25 +02:00
|
|
|
SCRIPT_ERR_NEGATIVE_LOCKTIME,
|
|
|
|
SCRIPT_ERR_UNSATISFIED_LOCKTIME,
|
|
|
|
|
2016-09-23 07:06:45 +02:00
|
|
|
/* Malleability */
|
2014-11-01 04:29:12 +01:00
|
|
|
SCRIPT_ERR_SIG_HASHTYPE,
|
|
|
|
SCRIPT_ERR_SIG_DER,
|
|
|
|
SCRIPT_ERR_MINIMALDATA,
|
|
|
|
SCRIPT_ERR_SIG_PUSHONLY,
|
|
|
|
SCRIPT_ERR_SIG_HIGH_S,
|
|
|
|
SCRIPT_ERR_SIG_NULLDUMMY,
|
2014-11-08 18:32:29 +01:00
|
|
|
SCRIPT_ERR_PUBKEYTYPE,
|
2014-10-13 03:39:47 +02:00
|
|
|
SCRIPT_ERR_CLEANSTACK,
|
2016-09-23 07:06:45 +02:00
|
|
|
SCRIPT_ERR_MINIMALIF,
|
2014-11-01 04:29:12 +01:00
|
|
|
|
2014-09-29 03:17:36 +02:00
|
|
|
/* softfork safeness */
|
|
|
|
SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS,
|
2015-11-08 01:16:45 +01:00
|
|
|
SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,
|
|
|
|
|
|
|
|
/* segregated witness */
|
|
|
|
SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH,
|
|
|
|
SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY,
|
|
|
|
SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH,
|
|
|
|
SCRIPT_ERR_WITNESS_MALLEATED,
|
|
|
|
SCRIPT_ERR_WITNESS_MALLEATED_P2SH,
|
|
|
|
SCRIPT_ERR_WITNESS_UNEXPECTED,
|
2014-09-29 03:17:36 +02:00
|
|
|
|
2014-11-01 04:29:12 +01:00
|
|
|
SCRIPT_ERR_ERROR_COUNT
|
|
|
|
} ScriptError;
|
|
|
|
|
|
|
|
#define SCRIPT_ERR_LAST SCRIPT_ERR_ERROR_COUNT
|
|
|
|
|
|
|
|
const char* ScriptErrorString(const ScriptError error);
|
|
|
|
|
2014-11-20 20:06:08 +01:00
|
|
|
#endif // BITCOIN_SCRIPT_SCRIPT_ERROR_H
|