Raven Core  3.0.0
P2P Digital Currency
ravenconsensus.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Copyright (c) 2017-2019 The Raven Core developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #ifndef RAVEN_RAVENCONSENSUS_H
8 #define RAVEN_RAVENCONSENSUS_H
9 
10 #include <stdint.h>
11 
12 #if defined(BUILD_RAVEN_INTERNAL) && defined(HAVE_CONFIG_H)
13 #include "config/raven-config.h"
14  #if defined(_WIN32)
15  #if defined(DLL_EXPORT)
16  #if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT)
17  #define EXPORT_SYMBOL __declspec(dllexport)
18  #else
19  #define EXPORT_SYMBOL
20  #endif
21  #endif
22  #elif defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY)
23  #define EXPORT_SYMBOL __attribute__ ((visibility ("default")))
24  #endif
25 #elif defined(MSC_VER) && !defined(STATIC_LIBRAVENCONSENSUS)
26  #define EXPORT_SYMBOL __declspec(dllimport)
27 #endif
28 
29 #ifndef EXPORT_SYMBOL
30  #define EXPORT_SYMBOL
31 #endif
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define RAVENCONSENSUS_API_VER 1
38 
40 {
48 
50 enum
51 {
53  ravenconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts
54  ravenconsensus_SCRIPT_FLAGS_VERIFY_DERSIG = (1U << 2), // enforce strict DER (BIP66) compliance
55  ravenconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY = (1U << 4), // enforce NULLDUMMY (BIP147)
56  ravenconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), // enable CHECKLOCKTIMEVERIFY (BIP65)
57  ravenconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY = (1U << 10), // enable CHECKSEQUENCEVERIFY (BIP112)
58  ravenconsensus_SCRIPT_FLAGS_VERIFY_WITNESS = (1U << 11), // enable WITNESS (BIP141)
62 };
63 
68 EXPORT_SYMBOL int ravenconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen,
69  const unsigned char *txTo , unsigned int txToLen,
70  unsigned int nIn, unsigned int flags, ravenconsensus_error* err);
71 
72 EXPORT_SYMBOL int ravenconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount,
73  const unsigned char *txTo , unsigned int txToLen,
74  unsigned int nIn, unsigned int flags, ravenconsensus_error* err);
75 
77 
78 #ifdef __cplusplus
79 } // extern "C"
80 #endif
81 
82 #undef EXPORT_SYMBOL
83 
84 #endif // RAVEN_RAVENCONSENSUS_H
int flags
Definition: raven-tx.cpp:500
EXPORT_SYMBOL int ravenconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, ravenconsensus_error *err)
Returns 1 if the input nIn of the serialized transaction pointed to by txTo correctly spends the scri...
ravenconsensus_error_t
#define EXPORT_SYMBOL
EXPORT_SYMBOL unsigned int ravenconsensus_version()
enum ravenconsensus_error_t ravenconsensus_error
EXPORT_SYMBOL int ravenconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, ravenconsensus_error *err)