diff options
| author | tobtoht <tob@featherwallet.org> | 2025-02-17 18:23:43 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2025-02-17 18:23:43 +0000 |
| commit | 0232839913b13cf0ab0bb7ad25fff0c05f37d2fe (patch) | |
| tree | ee8dc86f5052e2e81f903a5fc9877492e92fd9fd | |
| parent | c476b87fcfc028735bfecc16974c813fbb6917c7 (diff) | |
| parent | 33e33fbca3b165b5bf5681a3e1c6fc136b1f84ea (diff) | |
| download | monzero-core-0232839913b13cf0ab0bb7ad25fff0c05f37d2fe.tar.gz monzero-core-0232839913b13cf0ab0bb7ad25fff0c05f37d2fe.tar.xz monzero-core-0232839913b13cf0ab0bb7ad25fff0c05f37d2fe.zip | |
Merge pull request #9805
33e33fbca BlockchainLMDB: fix data.mdb nuking on Windows (jeffro256)
| -rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 98d8c6e91..938fc306c 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1405,9 +1405,10 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags) LOG_PRINT_L0("Failed to disable NTFS compression on folder: " << filename << ". Error: " << ::GetLastError()); boost::filesystem::path datafile(filename); datafile /= CRYPTONOTE_BLOCKCHAINDATA_FILENAME; - boost::filesystem::ofstream(datafile).close(); // touch the file to ensure it exists + if (!boost::filesystem::exists(datafile)) + boost::filesystem::ofstream(datafile).close(); // create the file to see if NTFS compression is enabled beforehand if (!disable_ntfs_compression(datafile)) - throw DB_ERROR("Database file is NTFS compressend and compression could not be disabled"); + throw DB_ERROR("Database file is NTFS compressed and compression could not be disabled"); #endif boost::optional<bool> is_hdd_result = tools::is_hdd(filename.c_str()); |
