Skip to content

Commit 89eddcd

Browse files
committed
index: Remove TxIndexDB from public interface of TxIndex.
1 parent 2318aff commit 89eddcd

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/index/txindex.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
std::unique_ptr<TxIndex> g_txindex;
1010

11-
TxIndex::TxIndex(std::unique_ptr<TxIndexDB> db) : m_db(std::move(db)) {}
11+
TxIndex::TxIndex(size_t n_cache_size, bool f_memory, bool f_wipe)
12+
: m_db(MakeUnique<TxIndex::DB>(n_cache_size, f_memory, f_wipe))
13+
{}
1214

1315
bool TxIndex::Init()
1416
{

src/index/txindex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class TxIndex final : public BaseIndex
2929

3030
public:
3131
/// Constructs the index, which becomes available to be queried.
32-
explicit TxIndex(std::unique_ptr<TxIndexDB> db);
32+
explicit TxIndex(size_t n_cache_size, bool f_memory = false, bool f_wipe = false);
3333

3434
/// Look up a transaction by hash.
3535
///

src/init.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,8 +1606,7 @@ bool AppInitMain()
16061606

16071607
// ********************************************************* Step 8: start indexers
16081608
if (gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
1609-
auto txindex_db = MakeUnique<TxIndexDB>(nTxIndexCache, false, fReindex);
1610-
g_txindex = MakeUnique<TxIndex>(std::move(txindex_db));
1609+
g_txindex = MakeUnique<TxIndex>(nTxIndexCache, false, fReindex);
16111610
g_txindex->Start();
16121611
}
16131612

src/test/txindex_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ BOOST_AUTO_TEST_SUITE(txindex_tests)
1515

1616
BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
1717
{
18-
TxIndex txindex(MakeUnique<TxIndexDB>(1 << 20, true));
18+
TxIndex txindex(1 << 20, true);
1919

2020
CTransactionRef tx_disk;
2121
uint256 block_hash;

0 commit comments

Comments
 (0)