diff --git a/nano/node/make_store.cpp b/nano/node/make_store.cpp index 87c15700fe..a167e93314 100644 --- a/nano/node/make_store.cpp +++ b/nano/node/make_store.cpp @@ -1,14 +1,15 @@ #include #include +#include #include #include -std::unique_ptr nano::make_store (nano::logger & logger, std::filesystem::path const & path, nano::ledger_constants & constants, bool read_only, bool add_db_postfix, nano::rocksdb_config const & rocksdb_config, nano::txn_tracking_config const & txn_tracking_config_a, std::chrono::milliseconds block_processor_batch_max_time_a, nano::lmdb_config const & lmdb_config_a, bool backup_before_upgrade) +std::unique_ptr nano::make_store (nano::logger & logger, std::filesystem::path const & path, nano::ledger_constants & constants, bool read_only, bool add_db_postfix, nano::node_config const & node_config) { - if (rocksdb_config.enable) + if (node_config.rocksdb_config.enable) { - return std::make_unique (logger, add_db_postfix ? path / "rocksdb" : path, constants, rocksdb_config, read_only); + return std::make_unique (logger, add_db_postfix ? path / "rocksdb" : path, constants, node_config.rocksdb_config, read_only); } - return std::make_unique (logger, add_db_postfix ? path / "data.ldb" : path, constants, txn_tracking_config_a, block_processor_batch_max_time_a, lmdb_config_a, backup_before_upgrade); + return std::make_unique (logger, add_db_postfix ? path / "data.ldb" : path, constants, node_config.diagnostics_config.txn_tracking, node_config.block_processor_batch_max_time, node_config.lmdb_config, node_config.backup_before_upgrade); } diff --git a/nano/node/make_store.hpp b/nano/node/make_store.hpp index 5f5b5f9372..22962b208c 100644 --- a/nano/node/make_store.hpp +++ b/nano/node/make_store.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -22,5 +23,5 @@ class component; namespace nano { -std::unique_ptr make_store (nano::logger &, std::filesystem::path const & path, nano::ledger_constants & constants, bool open_read_only = false, bool add_db_postfix = true, nano::rocksdb_config const & rocksdb_config = nano::rocksdb_config{}, nano::txn_tracking_config const & txn_tracking_config_a = nano::txn_tracking_config{}, std::chrono::milliseconds block_processor_batch_max_time_a = std::chrono::milliseconds (5000), nano::lmdb_config const & lmdb_config_a = nano::lmdb_config{}, bool backup_before_upgrade = false); +std::unique_ptr make_store (nano::logger &, std::filesystem::path const & path, nano::ledger_constants & constants, bool read_only = false, bool add_db_postfix = true, nano::node_config const & node_config = nano::node_config{}); } diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 259ca63c67..8bcfeea532 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -107,7 +107,7 @@ nano::node::node (std::shared_ptr io_ctx_a, std::filesy work{ work_a }, distributed_work_impl{ std::make_unique (*this) }, distributed_work{ *distributed_work_impl }, - store_impl{ nano::make_store (logger, application_path_a, network_params.ledger, flags.read_only, true, config_a.rocksdb_config, config_a.diagnostics_config.txn_tracking, config_a.block_processor_batch_max_time, config_a.lmdb_config, config_a.backup_before_upgrade) }, + store_impl{ nano::make_store (logger, application_path_a, network_params.ledger, flags.read_only, true, config_a) }, store{ *store_impl }, unchecked_impl{ std::make_unique (config.max_unchecked_blocks, stats, flags.disable_block_processor_unchecked_deletion) }, unchecked{ *unchecked_impl }, diff --git a/nano/secure/ledger.cpp b/nano/secure/ledger.cpp index 60d39ab1c3..a03277613d 100644 --- a/nano/secure/ledger.cpp +++ b/nano/secure/ledger.cpp @@ -1303,9 +1303,9 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p auto error (false); // Open rocksdb database - nano::rocksdb_config rocksdb_config; - rocksdb_config.enable = true; - auto rocksdb_store = nano::make_store (logger, data_path_a, nano::dev::constants, false, true, rocksdb_config); + nano::node_config node_config; + node_config.rocksdb_config.enable = true; + auto rocksdb_store = nano::make_store (logger, data_path_a, nano::dev::constants, false, true, node_config); if (!rocksdb_store->init_error ()) {