From 343d4b07d372841d2a9f628848ab45228464ec5f Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 28 Sep 2023 21:52:25 +0700 Subject: [PATCH] fix: descriptor wallets follow-up for bitcoin#20156: Make sqlite support optional (compile-time) --- src/qt/createwalletdialog.cpp | 6 ++++++ src/wallet/rpcwallet.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp index ca29613b8d53e..12afcfe1c340c 100644 --- a/src/qt/createwalletdialog.cpp +++ b/src/qt/createwalletdialog.cpp @@ -51,6 +51,12 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) : ui->encrypt_wallet_checkbox->setChecked(false); } }); + +#ifndef USE_SQLITE + ui->descriptor_checkbox->setToolTip(tr("Compiled without sqlite support (required for descriptor wallets)")); + ui->descriptor_checkbox->setEnabled(false); + ui->descriptor_checkbox->setChecked(false); +#endif } CreateWalletDialog::~CreateWalletDialog() diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 8fd802c5f6faf..84608b9fc8bad 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2934,6 +2934,9 @@ static UniValue createwallet(const JSONRPCRequest& request) flags |= WALLET_FLAG_AVOID_REUSE; } if (!request.params[5].isNull() && request.params[5].get_bool()) { +#ifndef USE_SQLITE + throw JSONRPCError(RPC_WALLET_ERROR, "Compiled without sqlite support (required for descriptor wallets)"); +#endif flags |= WALLET_FLAG_DESCRIPTORS; warnings.emplace_back(Untranslated("Wallet is an experimental descriptor wallet")); }