mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
refactor, txdb: Use DBParams struct in CBlockTreeDB
Use DBParams struct to remove ArgsManager uses from txdb. To reduce size of this commit, this moves references to gArgs variable out of txdb.cpp to calling code in chainstate.cpp. But these moves are temporary. The gArgs references in chainstate.cpp are moved out to calling code in init.cpp in later commits. This commit does not change behavior.
This commit is contained in:
@@ -184,7 +184,10 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve
|
||||
.check_block_index = true,
|
||||
};
|
||||
m_node.chainman = std::make_unique<ChainstateManager>(chainman_opts);
|
||||
m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<CBlockTreeDB>(m_cache_sizes.block_tree_db, true);
|
||||
m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<CBlockTreeDB>(DBParams{
|
||||
.path = m_args.GetDataDirNet() / "blocks" / "index",
|
||||
.cache_bytes = static_cast<size_t>(m_cache_sizes.block_tree_db),
|
||||
.memory_only = true});
|
||||
|
||||
constexpr int script_check_threads = 2;
|
||||
StartScriptCheckWorkerThreads(script_check_threads);
|
||||
|
||||
Reference in New Issue
Block a user