From 33af98c042340f6431aa93b4b6f893d85f40f237 Mon Sep 17 00:00:00 2001 From: Nsable-sh Date: Fri, 14 Aug 2026 08:48:26 -0300 Subject: wallet: drop bdb log check from storage sanity --- src/walletcmd.cpp | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'src/walletcmd.cpp') diff --git a/src/walletcmd.cpp b/src/walletcmd.cpp index 6fc8c38..ce0da02 100644 --- a/src/walletcmd.cpp +++ b/src/walletcmd.cpp @@ -13,10 +13,6 @@ #include "bip32.h" #include "walletcmd.h" -#ifndef _WIN32 -#include -#endif - #undef printf // How far ahead to look for used addresses when restoring. @@ -657,51 +653,6 @@ static bool WriteAuditTextFile(const std::string& strPath, return true; } -static bool DirectoryHasFileWithPrefixLocal(const std::string& strDir, - const std::string& strPrefix) -{ -#ifdef _WIN32 - std::string pattern = strDir + "/*"; - WIN32_FIND_DATAA findData; - HANDLE hFind = FindFirstFileA(pattern.c_str(), &findData); - if (hFind == INVALID_HANDLE_VALUE) - return false; - bool fFound = false; - do - { - if ((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) - { - std::string name = findData.cFileName; - if (name.compare(0, strPrefix.size(), strPrefix) == 0) - { - fFound = true; - break; - } - } - } - while (FindNextFileA(hFind, &findData)); - FindClose(hFind); - return fFound; -#else - DIR* dir = opendir(strDir.c_str()); - if (!dir) - return false; - bool fFound = false; - struct dirent* ent; - while ((ent = readdir(dir)) != NULL) - { - std::string name = ent->d_name; - if (name.compare(0, strPrefix.size(), strPrefix) == 0) - { - fFound = true; - break; - } - } - closedir(dir); - return fFound; -#endif -} - static void AddWalletStorageFailure(std::vector& vFailures, const std::string& strFailure) { @@ -742,8 +693,6 @@ static void BuildWalletStorageSanityFailures(const WalletStorageAuditCounts& cou AddWalletStorageFailure(vFailures, "encrypted wallet has no encryption master key record"); if (counts.nWalletMinVersion == 0) AddWalletStorageFailure(vFailures, "encrypted wallet has no minimum-version record"); - if (DirectoryHasFileWithPrefixLocal(GetAppDir() + "/database", "log.")) - AddWalletStorageFailure(vFailures, "Berkeley DB log files are still present for an encrypted wallet"); } } -- cgit v1.2.3