diff --git a/libraries/core_libs/node/src/node.cpp b/libraries/core_libs/node/src/node.cpp index 2e6002d89e..33d89035a6 100644 --- a/libraries/core_libs/node/src/node.cpp +++ b/libraries/core_libs/node/src/node.cpp @@ -63,7 +63,9 @@ void FullNode::init() { conf_.db_config.db_max_open_files, conf_.db_config.db_max_snapshots, conf_.db_config.db_revert_to_period, node_addr, true); } - db_ = std::make_shared(conf_.db_path, conf_.db_config.db_snapshot_each_n_pbft_block, + db_ = std::make_shared(conf_.db_path, + // Snapshots should be disabled while rebuilding + conf_.db_config.rebuild_db ? 0 : conf_.db_config.db_snapshot_each_n_pbft_block, conf_.db_config.db_max_open_files, conf_.db_config.db_max_snapshots, conf_.db_config.db_revert_to_period, node_addr, false); @@ -74,7 +76,8 @@ void FullNode::init() { old_db_ = std::make_shared(conf_.db_path, conf_.db_config.db_snapshot_each_n_pbft_block, conf_.db_config.db_max_open_files, conf_.db_config.db_max_snapshots, conf_.db_config.db_revert_to_period, node_addr, true); - db_ = std::make_shared(conf_.db_path, conf_.db_config.db_snapshot_each_n_pbft_block, + db_ = std::make_shared(conf_.db_path, + 0, // Snapshots should be disabled while rebuilding conf_.db_config.db_max_open_files, conf_.db_config.db_max_snapshots, conf_.db_config.db_revert_to_period, node_addr); } else if (db_->hasMinorVersionChanged()) {