14 # define ExistsSQLiteDatabase(path) (false)
23 if (!fs::is_directory(path)) {
31 if (fs::is_directory(path /
"wallets")) {
42 const size_t offset = wallet_dir.string().size() + 1;
43 std::vector<fs::path> paths;
44 boost::system::error_code ec;
46 for (
auto it = fs::recursive_directory_iterator(wallet_dir, ec);
it != fs::recursive_directory_iterator();
it.increment(ec)) {
48 LogPrintf(
"%s: %s %s\n", __func__, ec.message(),
it->path().string());
55 const fs::path path =
it->path().string().substr(offset);
57 if (
it->status().type() == fs::directory_file &&
60 paths.emplace_back(path);
62 if (
it->path().filename() ==
"wallet.dat") {
71 paths.emplace_back(path);
74 }
catch (
const std::exception& e) {
75 LogPrintf(
"%s: Error scanning %s: %s\n", __func__,
it->path().string(), e.what());
85 return wallet_version >= feature_version;
92 if (version >= wf)
return wf;
bool IsFeatureSupported(int wallet_version, int feature_version)
static void LogPrintf(const char *fmt, const Args &...args)
bool ExistsBerkeleyDatabase(const fs::path &path)
Check if Berkeley database exists at specified path.
WalletFeature GetClosestWalletFeature(int version)
WalletFeature
(client) version numbers for particular wallet features
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
fs::path GetWalletDir()
Get the path of the wallet directory.
const fs::path & GetDataDir(bool fNetSpecific)
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
std::vector< fs::path > ListWalletDir()
Get wallets in wallet directory.
#define ExistsSQLiteDatabase(path)