Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

script_error.h 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright (c) 2009-2010 Satoshi Nakamoto
  2. // Copyright (c) 2009-2016 The Starwels developers
  3. // Distributed under the MIT software license, see the accompanying
  4. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  5. #ifndef STARWELS_SCRIPT_SCRIPT_ERROR_H
  6. #define STARWELS_SCRIPT_SCRIPT_ERROR_H
  7. typedef enum ScriptError_t
  8. {
  9. SCRIPT_ERR_OK = 0,
  10. SCRIPT_ERR_UNKNOWN_ERROR,
  11. SCRIPT_ERR_EVAL_FALSE,
  12. SCRIPT_ERR_OP_RETURN,
  13. /* Max sizes */
  14. SCRIPT_ERR_SCRIPT_SIZE,
  15. SCRIPT_ERR_PUSH_SIZE,
  16. SCRIPT_ERR_OP_COUNT,
  17. SCRIPT_ERR_STACK_SIZE,
  18. SCRIPT_ERR_SIG_COUNT,
  19. SCRIPT_ERR_PUBKEY_COUNT,
  20. /* Failed verify operations */
  21. SCRIPT_ERR_VERIFY,
  22. SCRIPT_ERR_EQUALVERIFY,
  23. SCRIPT_ERR_CHECKMULTISIGVERIFY,
  24. SCRIPT_ERR_CHECKSIGVERIFY,
  25. SCRIPT_ERR_NUMEQUALVERIFY,
  26. /* Logical/Format/Canonical errors */
  27. SCRIPT_ERR_BAD_OPCODE,
  28. SCRIPT_ERR_DISABLED_OPCODE,
  29. SCRIPT_ERR_INVALID_STACK_OPERATION,
  30. SCRIPT_ERR_INVALID_ALTSTACK_OPERATION,
  31. SCRIPT_ERR_UNBALANCED_CONDITIONAL,
  32. /* CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY */
  33. SCRIPT_ERR_NEGATIVE_LOCKTIME,
  34. SCRIPT_ERR_UNSATISFIED_LOCKTIME,
  35. /* Malleability */
  36. SCRIPT_ERR_SIG_HASHTYPE,
  37. SCRIPT_ERR_SIG_DER,
  38. SCRIPT_ERR_MINIMALDATA,
  39. SCRIPT_ERR_SIG_PUSHONLY,
  40. SCRIPT_ERR_SIG_HIGH_S,
  41. SCRIPT_ERR_SIG_NULLDUMMY,
  42. SCRIPT_ERR_PUBKEYTYPE,
  43. SCRIPT_ERR_CLEANSTACK,
  44. SCRIPT_ERR_MINIMALIF,
  45. SCRIPT_ERR_SIG_NULLFAIL,
  46. /* softfork safeness */
  47. SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS,
  48. SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,
  49. /* segregated witness */
  50. SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH,
  51. SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY,
  52. SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH,
  53. SCRIPT_ERR_WITNESS_MALLEATED,
  54. SCRIPT_ERR_WITNESS_MALLEATED_P2SH,
  55. SCRIPT_ERR_WITNESS_UNEXPECTED,
  56. SCRIPT_ERR_WITNESS_PUBKEYTYPE,
  57. SCRIPT_ERR_ERROR_COUNT
  58. } ScriptError;
  59. #define SCRIPT_ERR_LAST SCRIPT_ERR_ERROR_COUNT
  60. const char* ScriptErrorString(const ScriptError error);
  61. #endif // STARWELS_SCRIPT_SCRIPT_ERROR_H