upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/walletcmd.cpp
diff options
context:
space:
mode:
authorNsable-sh <nsable-sh@noreply.git.bitflash.network>2026-08-14 08:48:26 -0300
committerNsable-sh <nsable-sh@noreply.git.bitflash.network>2026-08-14 08:48:26 -0300
commit33af98c042340f6431aa93b4b6f893d85f40f237 (patch)
tree8487caa5b4471b1203b46e0f73fce0362bf2c950 /src/walletcmd.cpp
parentb3088010726c9ab1ceeaa84357e91a8f81763fe2 (diff)
wallet: drop bdb log check from storage sanity
Diffstat (limited to 'src/walletcmd.cpp')
-rw-r--r--src/walletcmd.cpp51
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
660static 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
705static void AddWalletStorageFailure(std::vector<std::string>& vFailures, 656static 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