walletutil: Wallets can also be sqlite

This commit is contained in:
Andrew Chow 2020-06-11 16:24:17 -04:00
parent ac38a87225
commit 9b78f3ce8e

View File

@ -8,6 +8,7 @@
#include <util/system.h> #include <util/system.h>
bool ExistsBerkeleyDatabase(const fs::path& path); bool ExistsBerkeleyDatabase(const fs::path& path);
bool ExistsSQLiteDatabase(const fs::path& path);
fs::path GetWalletDir() fs::path GetWalletDir()
{ {
@ -48,7 +49,8 @@ std::vector<fs::path> ListWalletDir()
// This can be replaced by boost::filesystem::lexically_relative once boost is bumped to 1.60. // This can be replaced by boost::filesystem::lexically_relative once boost is bumped to 1.60.
const fs::path path = it->path().string().substr(offset); const fs::path path = it->path().string().substr(offset);
if (it->status().type() == fs::directory_file && ExistsBerkeleyDatabase(it->path())) { if (it->status().type() == fs::directory_file &&
(ExistsBerkeleyDatabase(it->path()) || ExistsSQLiteDatabase(it->path()))) {
// Found a directory which contains wallet.dat btree file, add it as a wallet. // Found a directory which contains wallet.dat btree file, add it as a wallet.
paths.emplace_back(path); paths.emplace_back(path);
} else if (it.level() == 0 && it->symlink_status().type() == fs::regular_file && ExistsBerkeleyDatabase(it->path())) { } else if (it.level() == 0 && it->symlink_status().type() == fs::regular_file && ExistsBerkeleyDatabase(it->path())) {