index: Remove TxIndexDB from public interface of TxIndex.

This commit is contained in:
Jim Posen committed 2018-06-04 19:22:28 -07:00
1 parent 2318affd27
commit 89eddcd365
4 files changed
+6 -5

No files matched your search

+3 -1
View File
@@ -8,7 +8,9 @@
std::unique_ptr<TxIndex> g_txindex; std::unique_ptr<TxIndex> g_txindex;
TxIndex::TxIndex(std::unique_ptr<TxIndexDB> db) : m_db(std::move(db)) {} TxIndex::TxIndex(size_t n_cache_size, bool f_memory, bool f_wipe)
: m_db(MakeUnique<TxIndex::DB>(n_cache_size, f_memory, f_wipe))
{}
bool TxIndex::Init() bool TxIndex::Init()
{ {
+1 -1
View File
@@ -29,7 +29,7 @@ protected:
public: public:
/// Constructs the index, which becomes available to be queried. /// Constructs the index, which becomes available to be queried.
explicit TxIndex(std::unique_ptr<TxIndexDB> db); explicit TxIndex(size_t n_cache_size, bool f_memory = false, bool f_wipe = false);
/// Look up a transaction by hash. /// Look up a transaction by hash.
/// ///
+1 -2
View File
@@ -1606,8 +1606,7 @@ bool AppInitMain()
// ********************************************************* Step 8: start indexers // ********************************************************* Step 8: start indexers
if (gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) { if (gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
auto txindex_db = MakeUnique<TxIndexDB>(nTxIndexCache, false, fReindex); g_txindex = MakeUnique<TxIndex>(nTxIndexCache, false, fReindex);
g_txindex = MakeUnique<TxIndex>(std::move(txindex_db));
g_txindex->Start(); g_txindex->Start();
} }
+1 -1
View File
@@ -15,7 +15,7 @@ BOOST_AUTO_TEST_SUITE(txindex_tests)
BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup) BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
{ {
TxIndex txindex(MakeUnique<TxIndexDB>(1 << 20, true)); TxIndex txindex(1 << 20, true);
CTransactionRef tx_disk; CTransactionRef tx_disk;
uint256 block_hash; uint256 block_hash;