only check database directory for compression, fallback to data dir

This commit is contained in:
eversinc33 2024-12-30 20:17:45 +01:00
parent d9dbc49f3b
commit ceff273d2a

View file

@ -277,17 +277,16 @@ int main(int argc, char const * argv[])
// Check for NTFS compression on both the data folder and the lmdb folder
// Compression can corrupt the blockchain on disk
if (isNtfsCompressed(data_dir.c_str()))
{
MERROR("Data directory is using NTFS compression, blockchain might get corrupted.");
}
bf::path db_path {bf::path(data_dir) / "lmdb"};
if (bf::exists(db_path))
boost::filesystem::path db_path{data_dir / "lmdb"};
if (boost::filesystem::exists(db_path))
{
if (isNtfsCompressed(db_path.c_str()))
{
MERROR("Database directory is using NTFS compression, blockchain might get corrupted.");
}
}
else
{
if (isNtfsCompressed(data_dir.c_str()))
MERROR("Data directory is using NTFS compression, blockchain might get corrupted.");
}
#endif