Skip to content

Commit

Permalink
walletutil: Wallets can also be sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Oct 14, 2020
1 parent ac38a87 commit 9b78f3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wallet/walletutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <util/system.h>

bool ExistsBerkeleyDatabase(const fs::path& path);
bool ExistsSQLiteDatabase(const fs::path& path);

fs::path GetWalletDir()
{
Expand Down Expand Up @@ -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.
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.
paths.emplace_back(path);
} else if (it.level() == 0 && it->symlink_status().type() == fs::regular_file && ExistsBerkeleyDatabase(it->path())) {
Expand Down

0 comments on commit 9b78f3c

Please sign in to comment.