Skip to content

Commit

Permalink
Exit migration if existing rocksdb ledger found
Browse files Browse the repository at this point in the history
  • Loading branch information
RickiNano committed Nov 2, 2024
1 parent c612519 commit 9858c73
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nano/secure/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,12 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p
boost::system::error_code error_chmod;
nano::set_secure_perm_directory (data_path_a, error_chmod);
auto rockdb_data_path = data_path_a / "rocksdb";
std::filesystem::remove_all (rockdb_data_path);

if (std::filesystem::exists (rockdb_data_path))
{
logger.error (nano::log::type::ledger, "Existing Rocksdb folder found in '{}'. Please remove it and try again.", rockdb_data_path.string ());
return true;
}

auto error (false);

Expand Down

0 comments on commit 9858c73

Please sign in to comment.