PIVX Core  5.6.99
P2P Digital Currency
bitcoinconsensus.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2014 The Bitcoin developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef PIVX_SCRIPT_BITCOINCONSENSUS_H
7 #define PIVX_SCRIPT_BITCOINCONSENSUS_H
8 
9 #if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H)
10 #include "config/pivx-config.h"
11  #if defined(_WIN32)
12  #if defined(DLL_EXPORT)
13  #if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT)
14  #define EXPORT_SYMBOL __declspec(dllexport)
15  #else
16  #define EXPORT_SYMBOL
17  #endif
18  #endif
19  #elif defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY)
20  #define EXPORT_SYMBOL __attribute__ ((visibility ("default")))
21  #endif
22 #elif defined(MSC_VER) && !defined(STATIC_LIBBITCOINCONSENSUS)
23  #define EXPORT_SYMBOL __declspec(dllimport)
24 #endif
25 
26 #ifndef EXPORT_SYMBOL
27  #define EXPORT_SYMBOL
28 #endif
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #define BITCOINCONSENSUS_API_VER 0
35 
37 {
43 
45 enum
46 {
48  bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts
49  bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG = (1U << 2), // enforce strict DER (BIP66) compliance
50 };
51 
56 EXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen,
57  const unsigned char *txTo , unsigned int txToLen,
58  unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err);
59 
61 
62 #ifdef __cplusplus
63 } // extern "C"
64 #endif
65 
66 #undef EXPORT_SYMBOL
67 
68 #endif // PIVX_SCRIPT_BITCOINCONSENSUS_H
enum bitcoinconsensus_error_t bitcoinconsensus_error
EXPORT_SYMBOL unsigned int bitcoinconsensus_version()
bitcoinconsensus_error_t
@ bitcoinconsensus_ERR_OK
@ bitcoinconsensus_ERR_TX_DESERIALIZE
@ bitcoinconsensus_ERR_TX_INDEX
@ bitcoinconsensus_ERR_TX_SIZE_MISMATCH
@ bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE
@ bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH
@ bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG
EXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
Returns 1 if the input nIn of the serialized transaction pointed to by txTo correctly spends the scri...
#define EXPORT_SYMBOL
int flags
Definition: pivx-tx.cpp:400