diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2022-01-13 07:57:54 -0500 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2022-07-18 13:39:55 -0500 |
commit | 33b4d48cfcdf145f49cb2283ac3e2936a4e23fff (patch) | |
tree | 482ca2545df1e67a06a7d027cc2275f89ae0cb75 /src/init.cpp | |
parent | a0b5b4ae5a24536d333cbce2ea584f2d935c651f (diff) |
indexes, refactor: Pass Chain interface instead of CChainState class to indexes
Passing abstract Chain interface will let indexes run in separate
processes.
This commit does not change behavior in any way.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp index 97c823fe0c..046857d60c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1594,22 +1594,22 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) return InitError(*error); } - g_txindex = std::make_unique<TxIndex>(cache_sizes.tx_index, false, fReindex); - if (!g_txindex->Start(chainman.ActiveChainstate())) { + g_txindex = std::make_unique<TxIndex>(interfaces::MakeChain(node), cache_sizes.tx_index, false, fReindex); + if (!g_txindex->Start()) { return false; } } for (const auto& filter_type : g_enabled_filter_types) { - InitBlockFilterIndex(filter_type, cache_sizes.filter_index, false, fReindex); - if (!GetBlockFilterIndex(filter_type)->Start(chainman.ActiveChainstate())) { + InitBlockFilterIndex([&]{ return interfaces::MakeChain(node); }, filter_type, cache_sizes.filter_index, false, fReindex); + if (!GetBlockFilterIndex(filter_type)->Start()) { return false; } } if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX)) { - g_coin_stats_index = std::make_unique<CoinStatsIndex>(/* cache size */ 0, false, fReindex); - if (!g_coin_stats_index->Start(chainman.ActiveChainstate())) { + g_coin_stats_index = std::make_unique<CoinStatsIndex>(interfaces::MakeChain(node), /* cache size */ 0, false, fReindex); + if (!g_coin_stats_index->Start()) { return false; } } |