]>
Commit | Line | Data |
---|---|---|
2cf5f16c | 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto |
f914f1a7 | 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers |
2cf5f16c CF |
3 | // Distributed under the MIT software license, see the accompanying |
4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
5 | ||
08d6b02d JG |
6 | #ifndef BITCOIN_ZCASHCONSENSUS_H |
7 | #define BITCOIN_ZCASHCONSENSUS_H | |
2cf5f16c | 8 | |
2d42e1a9 PW |
9 | #include <stdint.h> |
10 | ||
2cf5f16c CF |
11 | #if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H) |
12 | #include "config/bitcoin-config.h" | |
13 | #if defined(_WIN32) | |
14 | #if defined(DLL_EXPORT) | |
15 | #if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT) | |
16 | #define EXPORT_SYMBOL __declspec(dllexport) | |
17 | #else | |
18 | #define EXPORT_SYMBOL | |
19 | #endif | |
20 | #endif | |
21 | #elif defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY) | |
22 | #define EXPORT_SYMBOL __attribute__ ((visibility ("default"))) | |
23 | #endif | |
08d6b02d | 24 | #elif defined(MSC_VER) && !defined(STATIC_LIBZCASHCONSENSUS) |
2cf5f16c CF |
25 | #define EXPORT_SYMBOL __declspec(dllimport) |
26 | #endif | |
27 | ||
28 | #ifndef EXPORT_SYMBOL | |
29 | #define EXPORT_SYMBOL | |
30 | #endif | |
31 | ||
32 | #ifdef __cplusplus | |
33 | extern "C" { | |
34 | #endif | |
35 | ||
08d6b02d | 36 | #define ZCASHCONSENSUS_API_VER 0 |
2cf5f16c | 37 | |
08d6b02d | 38 | typedef enum zcashconsensus_error_t |
2cf5f16c | 39 | { |
08d6b02d JG |
40 | zcashconsensus_ERR_OK = 0, |
41 | zcashconsensus_ERR_TX_INDEX, | |
42 | zcashconsensus_ERR_TX_SIZE_MISMATCH, | |
43 | zcashconsensus_ERR_TX_DESERIALIZE, | |
44 | } zcashconsensus_error; | |
2cf5f16c CF |
45 | |
46 | /** Script verification flags */ | |
47 | enum | |
48 | { | |
08d6b02d JG |
49 | zcashconsensus_SCRIPT_FLAGS_VERIFY_NONE = 0, |
50 | zcashconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts | |
08d6b02d | 51 | zcashconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), // enable CHECKLOCKTIMEVERIFY (BIP65) |
2cf5f16c CF |
52 | }; |
53 | ||
54 | /// Returns 1 if the input nIn of the serialized transaction pointed to by | |
55 | /// txTo correctly spends the scriptPubKey pointed to by scriptPubKey under | |
56 | /// the additional constraints specified by flags. | |
57 | /// If not NULL, err will contain an error/success code for the operation | |
08d6b02d | 58 | EXPORT_SYMBOL int zcashconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, |
2cf5f16c | 59 | const unsigned char *txTo , unsigned int txToLen, |
08d6b02d | 60 | unsigned int nIn, unsigned int flags, zcashconsensus_error* err); |
2cf5f16c | 61 | |
08d6b02d | 62 | EXPORT_SYMBOL unsigned int zcashconsensus_version(); |
2cf5f16c CF |
63 | |
64 | #ifdef __cplusplus | |
65 | } // extern "C" | |
66 | #endif | |
67 | ||
68 | #undef EXPORT_SYMBOL | |
69 | ||
08d6b02d | 70 | #endif // BITCOIN_ZCASHCONSENSUS_H |