From 0352258148c51572426666d337c7b28d0033376c Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Tue, 16 Aug 2022 23:32:55 -0400 Subject: 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. --- src/test/util/setup_common.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/test/util/setup_common.cpp') diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 6e72f69968..2318380c6e 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -184,7 +184,10 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve .check_block_index = true, }; m_node.chainman = std::make_unique(chainman_opts); - m_node.chainman->m_blockman.m_block_tree_db = std::make_unique(m_cache_sizes.block_tree_db, true); + m_node.chainman->m_blockman.m_block_tree_db = std::make_unique(DBParams{ + .path = m_args.GetDataDirNet() / "blocks" / "index", + .cache_bytes = static_cast(m_cache_sizes.block_tree_db), + .memory_only = true}); constexpr int script_check_threads = 2; StartScriptCheckWorkerThreads(script_check_threads); -- cgit v1.2.3