diff options
| author | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-14 08:48:26 -0300 |
|---|---|---|
| committer | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-14 08:48:26 -0300 |
| commit | 33af98c042340f6431aa93b4b6f893d85f40f237 (patch) | |
| tree | 8487caa5b4471b1203b46e0f73fce0362bf2c950 | |
| parent | b3088010726c9ab1ceeaa84357e91a8f81763fe2 (diff) | |
wallet: drop bdb log check from storage sanity
| -rw-r--r-- | src/walletcmd.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
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 @@ | |||
| 13 | #include "bip32.h" | 13 | #include "bip32.h" |
| 14 | #include "walletcmd.h" | 14 | #include "walletcmd.h" |
| 15 | 15 | ||
| 16 | #ifndef _WIN32 | ||
| 17 | #include <dirent.h> | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #undef printf | 16 | #undef printf |
| 21 | 17 | ||
| 22 | // How far ahead to look for used addresses when restoring. | 18 | // How far ahead to look for used addresses when restoring. |
| @@ -657,51 +653,6 @@ static bool WriteAuditTextFile(const std::string& strPath, | |||
| 657 | return true; | 653 | return true; |
| 658 | } | 654 | } |
| 659 | 655 | ||
| 660 | static bool DirectoryHasFileWithPrefixLocal(const std::string& strDir, | ||
| 661 | const std::string& strPrefix) | ||
| 662 | { | ||
| 663 | #ifdef _WIN32 | ||
| 664 | std::string pattern = strDir + "/*"; | ||
| 665 | WIN32_FIND_DATAA findData; | ||
| 666 | HANDLE hFind = FindFirstFileA(pattern.c_str(), &findData); | ||
| 667 | if (hFind == INVALID_HANDLE_VALUE) | ||
| 668 | return false; | ||
| 669 | bool fFound = false; | ||
| 670 | do | ||
| 671 | { | ||
| 672 | if ((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) | ||
| 673 | { | ||
| 674 | std::string name = findData.cFileName; | ||
| 675 | if (name.compare(0, strPrefix.size(), strPrefix) == 0) | ||
| 676 | { | ||
| 677 | fFound = true; | ||
| 678 | break; | ||
| 679 | } | ||
| 680 | } | ||
| 681 | } | ||
| 682 | while (FindNextFileA(hFind, &findData)); | ||
| 683 | FindClose(hFind); | ||
| 684 | return fFound; | ||
| 685 | #else | ||
| 686 | DIR* dir = opendir(strDir.c_str()); | ||
| 687 | if (!dir) | ||
| 688 | return false; | ||
| 689 | bool fFound = false; | ||
| 690 | struct dirent* ent; | ||
| 691 | while ((ent = readdir(dir)) != NULL) | ||
| 692 | { | ||
| 693 | std::string name = ent->d_name; | ||
| 694 | if (name.compare(0, strPrefix.size(), strPrefix) == 0) | ||
| 695 | { | ||
| 696 | fFound = true; | ||
| 697 | break; | ||
| 698 | } | ||
| 699 | } | ||
| 700 | closedir(dir); | ||
| 701 | return fFound; | ||
| 702 | #endif | ||
| 703 | } | ||
| 704 | |||
| 705 | static void AddWalletStorageFailure(std::vector<std::string>& vFailures, | 656 | static void AddWalletStorageFailure(std::vector<std::string>& vFailures, |
| 706 | const std::string& strFailure) | 657 | const std::string& strFailure) |
| 707 | { | 658 | { |
| @@ -742,8 +693,6 @@ static void BuildWalletStorageSanityFailures(const WalletStorageAuditCounts& cou | |||
| 742 | AddWalletStorageFailure(vFailures, "encrypted wallet has no encryption master key record"); | 693 | AddWalletStorageFailure(vFailures, "encrypted wallet has no encryption master key record"); |
| 743 | if (counts.nWalletMinVersion == 0) | 694 | if (counts.nWalletMinVersion == 0) |
| 744 | AddWalletStorageFailure(vFailures, "encrypted wallet has no minimum-version record"); | 695 | AddWalletStorageFailure(vFailures, "encrypted wallet has no minimum-version record"); |
| 745 | if (DirectoryHasFileWithPrefixLocal(GetAppDir() + "/database", "log.")) | ||
| 746 | AddWalletStorageFailure(vFailures, "Berkeley DB log files are still present for an encrypted wallet"); | ||
| 747 | } | 696 | } |
| 748 | } | 697 | } |
| 749 | 698 | ||