File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed
Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 88
99std::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
1315bool TxIndex::Init ()
1416{
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class TxIndex final : public BaseIndex
2929
3030public:
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 // /
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ BOOST_AUTO_TEST_SUITE(txindex_tests)
1515
1616BOOST_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;
You can’t perform that action at this time.
0 commit comments