Skip to content

Commit 97c0ce7

Browse files
committed
Merge pull request monero-project#9804
418a9ad BlockchainLMDB: fix data.mdb nuking on Windows (jeffro256)
2 parents 802844d + 418a9ad commit 97c0ce7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/blockchain_db/lmdb/db_lmdb.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,9 +1405,10 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags)
14051405
LOG_PRINT_L0("Failed to disable NTFS compression on folder: " << filename << ". Error: " << ::GetLastError());
14061406
boost::filesystem::path datafile(filename);
14071407
datafile /= CRYPTONOTE_BLOCKCHAINDATA_FILENAME;
1408-
boost::filesystem::ofstream(datafile).close(); // touch the file to ensure it exists
1408+
if (!boost::filesystem::exists(datafile))
1409+
boost::filesystem::ofstream(datafile).close(); // create the file to see if NTFS compression is enabled beforehand
14091410
if (!disable_ntfs_compression(datafile))
1410-
throw DB_ERROR("Database file is NTFS compressend and compression could not be disabled");
1411+
throw DB_ERROR("Database file is NTFS compressed and compression could not be disabled");
14111412
#endif
14121413

14131414
boost::optional<bool> is_hdd_result = tools::is_hdd(filename.c_str());

0 commit comments

Comments
 (0)