mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
refactor, blockstorage: Replace blocksdir arg
Add a blocks_dir field to the BlockManager options. Move functions relying on the global gArgs to get the blocks_dir into the BlockManager class. This should eventually allow users of the BlockManager to not rely on the global Args and instead pass in their own options.
This commit is contained in:
parent
02a0899527
commit
18e5ba7c80
7 changed files with 22 additions and 11 deletions
|
|
@ -62,6 +62,7 @@
|
|||
using kernel::ValidationCacheSizes;
|
||||
using node::ApplyArgsManOptions;
|
||||
using node::BlockAssembler;
|
||||
using node::BlockManager;
|
||||
using node::CalculateCacheSizes;
|
||||
using node::LoadChainstate;
|
||||
using node::RegenerateCommitments;
|
||||
|
|
@ -186,8 +187,9 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, const std::vecto
|
|||
.adjusted_time_callback = GetAdjustedTime,
|
||||
.check_block_index = true,
|
||||
};
|
||||
node::BlockManager::Options blockman_opts{
|
||||
const BlockManager::Options blockman_opts{
|
||||
.chainparams = chainman_opts.chainparams,
|
||||
.blocks_dir = m_args.GetBlocksDirPath(),
|
||||
};
|
||||
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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue