diff --git a/doc/build-unix.md b/doc/build-unix.md index 7d1b93eb25..e700601daf 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -43,7 +43,7 @@ Optional dependencies: gmp | Optimized math routines | Arbitrary precision arithmetic library miniupnpc | UPnP Support | Firewall-jumping support libnatpmp | NAT-PMP Support | Firewall-jumping support - libdb4.8 | Berkeley DB | Wallet storage (only needed when wallet enabled) + libdb4.8 | Berkeley DB | Optional, wallet storage (only needed when wallet enabled) qt | GUI | GUI toolkit (only needed when GUI enabled) libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled) libzmq3 | ZMQ notification | Optional, allows generating ZMQ notifications (requires ZMQ version >= 4.0.0) diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp index 12afcfe1c3..37ccd17edb 100644 --- a/src/qt/createwalletdialog.cpp +++ b/src/qt/createwalletdialog.cpp @@ -57,6 +57,10 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) : ui->descriptor_checkbox->setEnabled(false); ui->descriptor_checkbox->setChecked(false); #endif +#ifndef USE_BDB + ui->descriptor_checkbox->setEnabled(false); + ui->descriptor_checkbox->setChecked(true); +#endif } CreateWalletDialog::~CreateWalletDialog() diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 84608b9fc8..b438ddb27b 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2941,6 +2941,11 @@ static UniValue createwallet(const JSONRPCRequest& request) warnings.emplace_back(Untranslated("Wallet is an experimental descriptor wallet")); } +#ifndef USE_BDB + if (!(flags & WALLET_FLAG_DESCRIPTORS)) { + throw JSONRPCError(RPC_WALLET_ERROR, "Compiled without bdb support (required for legacy wallets)"); + } +#endif DatabaseOptions options; DatabaseStatus status; options.require_create = true;