Add BlockManagerOpts::chainparams reference

and use it in blockstorage.cpp
This commit is contained in:
MarcoFalke
2023-05-04 12:19:35 +02:00
parent 6c7ebcc14b
commit facdb8b331
8 changed files with 31 additions and 9 deletions

View File

@@ -185,7 +185,10 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve
.adjusted_time_callback = GetAdjustedTime,
.check_block_index = true,
};
m_node.chainman = std::make_unique<ChainstateManager>(chainman_opts, node::BlockManager::Options{});
node::BlockManager::Options blockman_opts{
.chainparams = chainman_opts.chainparams,
};
m_node.chainman = std::make_unique<ChainstateManager>(chainman_opts, blockman_opts);
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),