diff options
author | warptangent <warptangent@inbox.com> | 2015-01-25 21:36:09 -0800 |
---|---|---|
committer | warptangent <warptangent@inbox.com> | 2015-02-02 11:53:09 -0800 |
commit | 84fe5fbd65100a731608471ef0a4c462ea8f5626 (patch) | |
tree | 70c9a0f292631feb8145aa97eff38f564087dc32 /src/cryptonote_core/tx_pool.h | |
parent | Merge PR 25 into blockchain (diff) | |
download | monero-84fe5fbd65100a731608471ef0a4c462ea8f5626.tar.xz |
Add compile-time support for both db implementations: in-memory and LMDB
Usage:
default is lmdb for blockchain branch:
$ make release
same as:
$ DATABASE=lmdb make release
for original in-memory implementation:
$ DATABASE=memory make release
Diffstat (limited to 'src/cryptonote_core/tx_pool.h')
-rw-r--r-- | src/cryptonote_core/tx_pool.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h index 7ff8c5e1c..b867a1a7d 100644 --- a/src/cryptonote_core/tx_pool.h +++ b/src/cryptonote_core/tx_pool.h @@ -44,10 +44,13 @@ #include "verification_context.h" #include "crypto/hash.h" - namespace cryptonote { +#if BLOCKCHAIN_DB == DB_LMDB class Blockchain; +#else + class blockchain_storage; +#endif /************************************************************************/ /* */ /************************************************************************/ @@ -55,7 +58,11 @@ namespace cryptonote class tx_memory_pool: boost::noncopyable { public: +#if BLOCKCHAIN_DB == DB_LMDB tx_memory_pool(Blockchain& bchs); +#else + tx_memory_pool(blockchain_storage& bchs); +#endif bool add_tx(const transaction &tx, const crypto::hash &id, size_t blob_size, tx_verification_context& tvc, bool keeped_by_block); bool add_tx(const transaction &tx, tx_verification_context& tvc, bool keeped_by_block); //gets tx and remove it from pool @@ -127,7 +134,11 @@ namespace cryptonote //transactions_container m_alternative_transactions; std::string m_config_folder; +#if BLOCKCHAIN_DB == DB_LMDB Blockchain& m_blockchain; +#else + blockchain_storage& m_blockchain; +#endif /************************************************************************/ /* */ /************************************************************************/ @@ -170,6 +181,12 @@ namespace cryptonote uint64_t operator()(const txin_to_scripthash& tx) const {return 0;} }; +#if BLOCKCHAIN_DB == DB_LMDB +#else +#if defined(DEBUG_CREATE_BLOCK_TEMPLATE) + friend class blockchain_storage; +#endif +#endif }; } |