Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
script_error.cpp
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
7
8#include <string>
9
11 switch (serror) {
12 case ScriptError::OK:
13 return "No error";
15 return "Script evaluated without error but finished with a "
16 "false/empty top stack element";
18 return "Script failed an OP_VERIFY operation";
20 return "Script failed an OP_EQUALVERIFY operation";
22 return "Script failed an OP_CHECKMULTISIGVERIFY operation";
24 return "Script failed an OP_CHECKSIGVERIFY operation";
26 return "Script failed an OP_CHECKDATASIGVERIFY operation";
28 return "Script failed an OP_NUMEQUALVERIFY operation";
30 return "Script is too big";
32 return "Push value size limit exceeded";
34 return "Operation limit exceeded";
36 return "Stack size limit exceeded";
38 return "Signature count negative or greater than pubkey count";
40 return "Pubkey count negative or limit exceeded";
42 return "Input SigChecks limit exceeded";
44 return "Invalid operand size";
46 return "Given operand is not a number within the valid range "
47 "[-2^31...2^31]";
49 return "The requested encoding is impossible to satisfy";
51 return "Invalid OP_SPLIT range";
53 return "Invalid number of bit set in OP_CHECKMULTISIG";
55 return "Opcode missing or not understood";
57 return "Attempted to use a disabled opcode";
59 return "Operation not valid with the current stack size";
61 return "Operation not valid with the current altstack size";
63 return "OP_RETURN was encountered";
65 return "Invalid OP_IF construction";
67 return "Division by zero error";
69 return "Modulo by zero error";
71 return "Bitfield of unexpected size error";
73 return "Bitfield's bit out of the expected range";
75 return "Negative locktime";
77 return "Locktime requirement not satisfied";
79 return "Signature hash type missing or not understood";
81 return "Non-canonical DER signature";
83 return "Data push larger than necessary";
85 return "Only push operators allowed in signatures";
87 return "Non-canonical signature: S value is unnecessarily high";
89 return "OP_IF/NOTIF argument must be minimal";
91 return "Signature must be zero for failed CHECK(MULTI)SIG "
92 "operation";
94 return "Signature cannot be 65 bytes in CHECKMULTISIG";
96 return "Only Schnorr signatures allowed in this operation";
98 return "NOPx reserved for soft-fork upgrades";
100 return "Public key is neither compressed or uncompressed";
102 return "Stack size must be exactly one after execution";
104 return "Illegal use of SIGHASH_FORKID";
106 return "Signature must use SIGHASH_FORKID";
108 return "Validation resources exceeded (SigChecks)";
111 default:
112 break;
113 }
114 return "unknown error";
115}
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
std::string ScriptErrorString(const ScriptError serror)
ScriptError
@ DISCOURAGE_UPGRADABLE_NOPS
@ INVALID_ALTSTACK_OPERATION
@ UNSATISFIED_LOCKTIME
@ INVALID_BITFIELD_SIZE
@ SIGCHECKS_LIMIT_EXCEEDED
@ INVALID_OPERAND_SIZE
@ INVALID_STACK_OPERATION
@ UNBALANCED_CONDITIONAL
@ INVALID_NUMBER_RANGE