Remove check is_directory check on lmdb path

The check interferes with raw device/partition support.
This commit is contained in:
Howard Chu 2021-07-07 16:28:27 +01:00
parent b096e16699
commit 033a32a20b
No known key found for this signature in database
GPG key ID: FD2A70B44AB11BA7

View file

@ -1307,14 +1307,8 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags)
throw0(DB_OPEN_FAILURE("Attempted to open db, but it's already open")); throw0(DB_OPEN_FAILURE("Attempted to open db, but it's already open"));
boost::filesystem::path direc(filename); boost::filesystem::path direc(filename);
if (boost::filesystem::exists(direc)) if (!boost::filesystem::exists(direc) &&
{ !boost::filesystem::create_directories(direc)) {
if (!boost::filesystem::is_directory(direc))
throw0(DB_OPEN_FAILURE("LMDB needs a directory path, but a file was passed"));
}
else
{
if (!boost::filesystem::create_directories(direc))
throw0(DB_OPEN_FAILURE(std::string("Failed to create directory ").append(filename).c_str())); throw0(DB_OPEN_FAILURE(std::string("Failed to create directory ").append(filename).c_str()));
} }