-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed compile on Ubuntu 22.04 with modern versions of libboost.
- Loading branch information
Matt Foster
committed
Jun 19, 2023
1 parent
cf47812
commit 7035cb1
Showing
12 changed files
with
229 additions
and
68 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright (c) 2009-2010 Satoshi Nakamoto | ||
// Copyright (c) 2009-2015 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef BITCOIN_BITCOINCONSENSUS_H | ||
#define BITCOIN_BITCOINCONSENSUS_H | ||
|
||
#if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H) | ||
#include "config/PEPEPOW-config.h" | ||
#if defined(_WIN32) | ||
#if defined(DLL_EXPORT) | ||
#if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT) | ||
#define EXPORT_SYMBOL __declspec(dllexport) | ||
#else | ||
#define EXPORT_SYMBOL | ||
#endif | ||
#endif | ||
#elif defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY) | ||
#define EXPORT_SYMBOL __attribute__ ((visibility ("default"))) | ||
#endif | ||
#elif defined(MSC_VER) && !defined(STATIC_LIBBITCOINCONSENSUS) | ||
#define EXPORT_SYMBOL __declspec(dllimport) | ||
#endif | ||
|
||
#ifndef EXPORT_SYMBOL | ||
#define EXPORT_SYMBOL | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define BITCOINCONSENSUS_API_VER 0 | ||
|
||
typedef enum PEPEPOWconsensus_error_t | ||
{ | ||
PEPEPOWconsensus_ERR_OK = 0, | ||
PEPEPOWconsensus_ERR_TX_INDEX, | ||
PEPEPOWconsensus_ERR_TX_SIZE_MISMATCH, | ||
PEPEPOWconsensus_ERR_TX_DESERIALIZE, | ||
} PEPEPOWconsensus_error; | ||
|
||
/** Script verification flags */ | ||
enum | ||
{ | ||
PEPEPOWconsensus_SCRIPT_FLAGS_VERIFY_NONE = 0, | ||
PEPEPOWconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts | ||
PEPEPOWconsensus_SCRIPT_FLAGS_VERIFY_DERSIG = (1U << 2), // enforce strict DER (BIP66) compliance | ||
PEPEPOWconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), // enable CHECKLOCKTIMEVERIFY (BIP65) | ||
}; | ||
|
||
/// Returns 1 if the input nIn of the serialized transaction pointed to by | ||
/// txTo correctly spends the scriptPubKey pointed to by scriptPubKey under | ||
/// the additional constraints specified by flags. | ||
/// If not NULL, err will contain an error/success code for the operation | ||
EXPORT_SYMBOL int PEPEPOWconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, | ||
const unsigned char *txTo , unsigned int txToLen, | ||
unsigned int nIn, unsigned int flags, PEPEPOWconsensus_error* err); | ||
|
||
EXPORT_SYMBOL unsigned int PEPEPOWconsensus_version(); | ||
|
||
#ifdef __cplusplus | ||
} // extern "C" | ||
#endif | ||
|
||
#undef EXPORT_SYMBOL | ||
|
||
#endif // BITCOIN_BITCOINCONSENSUS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#ifndef BITCOIN_TEST_TEST_PEPE_H | ||
#define BITCOIN_TEST_TEST_PEPE_H | ||
|
||
#include "chainparamsbase.h" | ||
#include "key.h" | ||
#include "pubkey.h" | ||
#include "txdb.h" | ||
#include "txmempool.h" | ||
|
||
#include <boost/filesystem.hpp> | ||
#include <boost/thread.hpp> | ||
|
||
/** Basic testing setup. | ||
* This just configures logging and chain parameters. | ||
*/ | ||
struct BasicTestingSetup { | ||
ECCVerifyHandle globalVerifyHandle; | ||
|
||
BasicTestingSetup(const std::string& chainName = CBaseChainParams::MAIN); | ||
~BasicTestingSetup(); | ||
}; | ||
|
||
/** Testing setup that configures a complete environment. | ||
* Included are data directory, coins database, script check threads | ||
* and wallet (if enabled) setup. | ||
*/ | ||
class CConnman; | ||
struct TestingSetup: public BasicTestingSetup { | ||
CCoinsViewDB *pcoinsdbview; | ||
boost::filesystem::path pathTemp; | ||
boost::thread_group threadGroup; | ||
CConnman* connman; | ||
|
||
TestingSetup(const std::string& chainName = CBaseChainParams::MAIN); | ||
~TestingSetup(); | ||
}; | ||
|
||
class CBlock; | ||
struct CMutableTransaction; | ||
class CScript; | ||
|
||
// | ||
// Testing fixture that pre-creates a | ||
// 100-block REGTEST-mode block chain | ||
// | ||
struct TestChain100Setup : public TestingSetup { | ||
TestChain100Setup(); | ||
|
||
// Create a new block with just given transactions, coinbase paying to | ||
// scriptPubKey, and try to add it to the current chain. | ||
CBlock CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, | ||
const CScript& scriptPubKey); | ||
|
||
~TestChain100Setup(); | ||
|
||
std::vector<CTransaction> coinbaseTxns; // For convenience, coinbase transactions | ||
CKey coinbaseKey; // private/public key needed to spend coinbase transactions | ||
}; | ||
|
||
class CTxMemPoolEntry; | ||
class CTxMemPool; | ||
|
||
struct TestMemPoolEntryHelper | ||
{ | ||
// Default values | ||
CAmount nFee; | ||
int64_t nTime; | ||
double dPriority; | ||
unsigned int nHeight; | ||
bool hadNoDependencies; | ||
bool spendsCoinbase; | ||
unsigned int sigOpCount; | ||
LockPoints lp; | ||
|
||
TestMemPoolEntryHelper() : | ||
nFee(0), nTime(0), dPriority(0.0), nHeight(1), | ||
hadNoDependencies(false), spendsCoinbase(false), sigOpCount(1) { } | ||
|
||
CTxMemPoolEntry FromTx(CMutableTransaction &tx, CTxMemPool *pool = NULL); | ||
|
||
// Change the default value | ||
TestMemPoolEntryHelper &Fee(CAmount _fee) { nFee = _fee; return *this; } | ||
TestMemPoolEntryHelper &Time(int64_t _time) { nTime = _time; return *this; } | ||
TestMemPoolEntryHelper &Priority(double _priority) { dPriority = _priority; return *this; } | ||
TestMemPoolEntryHelper &Height(unsigned int _height) { nHeight = _height; return *this; } | ||
TestMemPoolEntryHelper &HadNoDependencies(bool _hnd) { hadNoDependencies = _hnd; return *this; } | ||
TestMemPoolEntryHelper &SpendsCoinbase(bool _flag) { spendsCoinbase = _flag; return *this; } | ||
TestMemPoolEntryHelper &SigOps(unsigned int _sigops) { sigOpCount = _sigops; return *this; } | ||
}; | ||
#endif |
Oops, something went wrong.