mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +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
11
src/init.cpp
11
src/init.cpp
|
|
@ -116,18 +116,19 @@ using kernel::DumpMempool;
|
|||
using kernel::ValidationCacheSizes;
|
||||
|
||||
using node::ApplyArgsManOptions;
|
||||
using node::BlockManager;
|
||||
using node::CacheSizes;
|
||||
using node::CalculateCacheSizes;
|
||||
using node::DEFAULT_PERSIST_MEMPOOL;
|
||||
using node::DEFAULT_PRINTPRIORITY;
|
||||
using node::DEFAULT_STOPAFTERBLOCKIMPORT;
|
||||
using node::fReindex;
|
||||
using node::LoadChainstate;
|
||||
using node::MempoolPath;
|
||||
using node::ShouldPersistMempool;
|
||||
using node::NodeContext;
|
||||
using node::ShouldPersistMempool;
|
||||
using node::ThreadImport;
|
||||
using node::VerifyLoadedChainstate;
|
||||
using node::fReindex;
|
||||
|
||||
static constexpr bool DEFAULT_PROXYRANDOMIZE{true};
|
||||
static constexpr bool DEFAULT_REST_ENABLE{false};
|
||||
|
|
@ -1037,8 +1038,9 @@ bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandb
|
|||
if (const auto error{ApplyArgsManOptions(args, chainman_opts_dummy)}) {
|
||||
return InitError(*error);
|
||||
}
|
||||
node::BlockManager::Options blockman_opts_dummy{
|
||||
BlockManager::Options blockman_opts_dummy{
|
||||
.chainparams = chainman_opts_dummy.chainparams,
|
||||
.blocks_dir = args.GetBlocksDirPath(),
|
||||
};
|
||||
if (const auto error{ApplyArgsManOptions(args, blockman_opts_dummy)}) {
|
||||
return InitError(*error);
|
||||
|
|
@ -1446,8 +1448,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
};
|
||||
Assert(!ApplyArgsManOptions(args, chainman_opts)); // no error can happen, already checked in AppInitParameterInteraction
|
||||
|
||||
node::BlockManager::Options blockman_opts{
|
||||
BlockManager::Options blockman_opts{
|
||||
.chainparams = chainman_opts.chainparams,
|
||||
.blocks_dir = args.GetBlocksDirPath(),
|
||||
};
|
||||
Assert(!ApplyArgsManOptions(args, blockman_opts)); // no error can happen, already checked in AppInitParameterInteraction
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue