diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -69,7 +69,7 @@ std::vector &warnings); std::shared_ptr CreateWallet(interfaces::Chain &chain, const std::string &name, - std::optional load_on_start, const DatabaseOptions &options, + std::optional load_on_start, DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector &warnings); std::unique_ptr HandleLoadWallet(LoadWalletFn load_wallet); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -279,12 +279,16 @@ std::shared_ptr CreateWallet(interfaces::Chain &chain, const std::string &name, - std::optional load_on_start, const DatabaseOptions &options, + std::optional load_on_start, DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector &warnings) { uint64_t wallet_creation_flags = options.create_flags; const SecureString &passphrase = options.create_passphrase; + if (wallet_creation_flags & WALLET_FLAG_DESCRIPTORS) { + options.require_format = DatabaseFormat::SQLITE; + } + // Indicate that the wallet is actually supposed to be blank and not just // blank to make it encrypted bool create_blank = (wallet_creation_flags & WALLET_FLAG_BLANK_WALLET); diff --git a/src/wallet/walletutil.cpp b/src/wallet/walletutil.cpp --- a/src/wallet/walletutil.cpp +++ b/src/wallet/walletutil.cpp @@ -8,6 +8,7 @@ #include bool ExistsBerkeleyDatabase(const fs::path &path); +bool ExistsSQLiteDatabase(const fs::path &path); fs::path GetWalletDir() { fs::path path; @@ -51,7 +52,8 @@ const fs::path path = it->path().string().substr(offset); if (it->status().type() == fs::directory_file && - ExistsBerkeleyDatabase(it->path())) { + (ExistsBerkeleyDatabase(it->path()) || + ExistsSQLiteDatabase(it->path()))) { // Found a directory which contains wallet.dat btree file, add it as // a wallet. paths.emplace_back(path);