-
Notifications
You must be signed in to change notification settings - Fork 405
Expand file tree
/
Copy pathscript_error.cpp
More file actions
103 lines (101 loc) · 5.18 KB
/
Copy pathscript_error.cpp
File metadata and controls
103 lines (101 loc) · 5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "script_error.h"
const char* ScriptErrorString(const ScriptError serror)
{
switch (serror)
{
case SCRIPT_ERR_OK:
return "No error";
case SCRIPT_ERR_EVAL_FALSE:
return "Script evaluated without error but finished with a false/empty top stack element";
case SCRIPT_ERR_VERIFY:
return "Script failed an OP_VERIFY operation";
case SCRIPT_ERR_EQUALVERIFY:
return "Script failed an OP_EQUALVERIFY operation";
case SCRIPT_ERR_CHECKMULTISIGVERIFY:
return "Script failed an OP_CHECKMULTISIGVERIFY operation";
case SCRIPT_ERR_CHECKSIGVERIFY:
return "Script failed an OP_CHECKSIGVERIFY operation";
case SCRIPT_ERR_NUMEQUALVERIFY:
return "Script failed an OP_NUMEQUALVERIFY operation";
case SCRIPT_ERR_SCRIPT_SIZE:
return "Script is too big";
case SCRIPT_ERR_PUSH_SIZE:
return "Push value size limit exceeded";
case SCRIPT_ERR_OP_COUNT:
return "Operation limit exceeded";
case SCRIPT_ERR_STACK_SIZE:
return "Stack size limit exceeded";
case SCRIPT_ERR_SIG_COUNT:
return "Signature count negative or greater than pubkey count";
case SCRIPT_ERR_PUBKEY_COUNT:
return "Pubkey count negative or limit exceeded";
case SCRIPT_ERR_BAD_OPCODE:
return "Opcode missing or not understood";
case SCRIPT_ERR_DISABLED_OPCODE:
return "Attempted to use a disabled opcode";
case SCRIPT_ERR_INVALID_STACK_OPERATION:
return "Operation not valid with the current stack size";
case SCRIPT_ERR_INVALID_ALTSTACK_OPERATION:
return "Operation not valid with the current altstack size";
case SCRIPT_ERR_OP_RETURN:
return "OP_RETURN was encountered";
case SCRIPT_ERR_UNBALANCED_CONDITIONAL:
return "Invalid OP_IF construction";
case SCRIPT_ERR_NEGATIVE_LOCKTIME:
return "Negative locktime";
case SCRIPT_ERR_UNSATISFIED_LOCKTIME:
return "Locktime requirement not satisfied";
case SCRIPT_ERR_SIG_HASHTYPE:
return "Signature hash type missing or not understood";
case SCRIPT_ERR_SIG_DER:
return "Non-canonical DER signature";
case SCRIPT_ERR_MINIMALDATA:
return "Data push larger than necessary";
case SCRIPT_ERR_SIG_PUSHONLY:
return "Only non-push operators allowed in signatures";
case SCRIPT_ERR_SIG_HIGH_S:
return "Non-canonical signature: S value is unnecessarily high";
case SCRIPT_ERR_SIG_NULLDUMMY:
return "Dummy CHECKMULTISIG argument must be zero";
case SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS:
return "NOPx reserved for soft-fork upgrades";
case SCRIPT_ERR_PUBKEYTYPE:
return "Public key is neither compressed or uncompressed";
case SCRIPT_ERR_WITHDRAW_VERIFY_FORMAT:
return "Withdraw proof validation failed - invalid proof format";
case SCRIPT_ERR_WITHDRAW_VERIFY_BLOCK:
return "Withdraw proof validation failed - SPV proof/block coinbase invalid";
case SCRIPT_ERR_WITHDRAW_VERIFY_LOCKTX:
return "Withdraw proof validation failed - locking transaction misformatted";
case SCRIPT_ERR_WITHDRAW_VERIFY_OUTPUT:
return "Withdraw proof validation failed - output does not match expected";
case SCRIPT_ERR_WITHDRAW_VERIFY_LOCKTIME:
return "Withdraw proof validation failed - locktime was not set correctly";
case SCRIPT_ERR_WITHDRAW_VERIFY_SECONDSCRIPT:
return "Withdraw proof validation failed - second script validation failed";
case SCRIPT_ERR_WITHDRAW_VERIFY_BLOCKCONFIRMED:
return "Withdraw proof validation failed - lock block was not sufficiently confirmed on sending chain";
case SCRIPT_ERR_WITHDRAW_VALUES_HIDDEN:
return "Withdraw proof validation failed - values were hidden";
case SCRIPT_ERR_REORG_VERIFY_FORMAT:
return "Reorg/Fraud proof validation failed - invalid proof format";
case SCRIPT_ERR_REORG_VERIFY_FRAUD_BLOCK:
return "Fraud proof validation failed - bad SPV proof for tx being spent by fraud proof";
case SCRIPT_ERR_REORG_VERIFY_FRAUD_ORIG_BLOCK:
return "Fraud proof validation failed - bad SPV proof for original withdraw tx";
case SCRIPT_ERR_REORG_VERIFY_FRAUD_ORIG_TX:
return "Fraud proof validation failed - bad or unmatched original withdraw tx";
case SCRIPT_ERR_REORG_VERIFY_FRAUD_OUTPUT:
return "Fraud proof validation failed - output does not match expected";
case SCRIPT_ERR_REORG_VALUES_HIDDEN:
return "Fraud proof validation failed - values were hidden";
case SCRIPT_ERR_UNKNOWN_ERROR:
case SCRIPT_ERR_ERROR_COUNT:
default: break;
}
return "unknown error";
}