Merge pull request #9805
Some checks failed
ci/gh-actions/cli / macOS (brew) (push) Has been cancelled
ci/gh-actions/cli / Windows (MSYS2) (push) Has been cancelled
ci/gh-actions/cli / Arch Linux (push) Has been cancelled
ci/gh-actions/cli / Debian 10 (push) Has been cancelled
ci/gh-actions/cli / ${{ matrix.name }} (ubuntu:20.04, Ubuntu 20.04) (push) Has been cancelled
ci/gh-actions/cli / ${{ matrix.name }} (ubuntu:22.04, Ubuntu 22.04) (push) Has been cancelled
ci/gh-actions/cli / source archive (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:aarch64-apple-darwin11 name:Cross-Mac aarch64 packages:cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python3-setuptools-git libtinfo5]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:aarch64-linux-gnu name:ARM v8 packages:python3 gperf g++-aarch64-linux-gnu]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:arm-linux-gnueabihf name:ARM v7 packages:python3 gperf g++-arm-linux-gnueabihf]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:i686-pc-linux-gnu name:i686 Linux packages:gperf cmake g++-multilib python3-zmq]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:i686-w64-mingw32 name:i686 Win packages:python3 g++-mingw-w64-i686]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:riscv64-linux-gnu name:RISCV 64bit packages:python3 gperf g++-riscv64-linux-gnu]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:x86_64-apple-darwin11 name:Cross-Mac x86_64 packages:cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python3-setuptools-git libtinfo5]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:x86_64-unknown-freebsd name:x86_64 Freebsd packages:clang-8 gperf cmake python3-zmq libdbus-1-dev libharfbuzz-dev]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:x86_64-unknown-linux-gnu name:x86_64 Linux packages:gperf cmake python3-zmq libdbus-1-dev libharfbuzz-dev]) (push) Has been cancelled
ci/gh-actions/depends / ${{ matrix.toolchain.name }} (map[host:x86_64-w64-mingw32 name:Win64 packages:cmake python3 g++-mingw-w64-x86-64]) (push) Has been cancelled
ci/gh-actions/cli / ${{ matrix.name }} (tests) (ubuntu:20.04, Ubuntu 20.04) (push) Has been cancelled

33e33fbca BlockchainLMDB: fix data.mdb nuking on Windows (jeffro256)
This commit is contained in:
tobtoht 2025-02-17 18:23:43 +00:00
commit 0232839913
No known key found for this signature in database
GPG Key ID: E45B10DD027D2472

View File

@ -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());