fix: descriptor wallets follow-up for bitcoin#20156: Make sqlite support optional (compile-time)

This commit is contained in:
Konstantin Akimov 2023-09-28 21:52:25 +07:00
parent fa30777494
commit 343d4b07d3
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
2 changed files with 9 additions and 0 deletions

View File

@ -51,6 +51,12 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
ui->encrypt_wallet_checkbox->setChecked(false); 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() CreateWalletDialog::~CreateWalletDialog()

View File

@ -2934,6 +2934,9 @@ static UniValue createwallet(const JSONRPCRequest& request)
flags |= WALLET_FLAG_AVOID_REUSE; flags |= WALLET_FLAG_AVOID_REUSE;
} }
if (!request.params[5].isNull() && request.params[5].get_bool()) { 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; flags |= WALLET_FLAG_DESCRIPTORS;
warnings.emplace_back(Untranslated("Wallet is an experimental descriptor wallet")); warnings.emplace_back(Untranslated("Wallet is an experimental descriptor wallet"));
} }