Changeset View
Changeset View
Standalone View
Standalone View
src/script/script_error.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_SCRIPT_SCRIPT_ERROR_H | #ifndef BITCOIN_SCRIPT_SCRIPT_ERROR_H | ||||
#define BITCOIN_SCRIPT_SCRIPT_ERROR_H | #define BITCOIN_SCRIPT_SCRIPT_ERROR_H | ||||
#include <string> | |||||
enum class ScriptError { | enum class ScriptError { | ||||
OK = 0, | OK = 0, | ||||
UNKNOWN, | UNKNOWN, | ||||
EVAL_FALSE, | EVAL_FALSE, | ||||
OP_RETURN, | OP_RETURN, | ||||
/* Max sizes */ | /* Max sizes */ | ||||
SCRIPT_SIZE, | SCRIPT_SIZE, | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | enum class ScriptError { | ||||
/* Auxiliary errors (unused by interpreter) */ | /* Auxiliary errors (unused by interpreter) */ | ||||
SIGCHECKS_LIMIT_EXCEEDED, | SIGCHECKS_LIMIT_EXCEEDED, | ||||
ERROR_COUNT, | ERROR_COUNT, | ||||
}; | }; | ||||
#define SCRIPT_ERR_LAST ScriptError::ERROR_COUNT | #define SCRIPT_ERR_LAST ScriptError::ERROR_COUNT | ||||
const char *ScriptErrorString(const ScriptError error); | std::string ScriptErrorString(const ScriptError error); | ||||
namespace { | namespace { | ||||
inline bool set_success(ScriptError *ret) { | inline bool set_success(ScriptError *ret) { | ||||
if (ret) { | if (ret) { | ||||
*ret = ScriptError::OK; | *ret = ScriptError::OK; | ||||
} | } | ||||
return true; | return true; | ||||
Show All 12 Lines |