Skip to content

Commit f6b3614

Browse files
committed
fix: descriptor wallets follow-up to merge bitcoin#20202: Make BDB support optional
1 parent a340ad6 commit f6b3614

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

doc/build-unix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Optional dependencies:
4343
gmp | Optimized math routines | Arbitrary precision arithmetic library
4444
miniupnpc | UPnP Support | Firewall-jumping support
4545
libnatpmp | NAT-PMP Support | Firewall-jumping support
46-
libdb4.8 | Berkeley DB | Wallet storage (only needed when wallet enabled)
46+
libdb4.8 | Berkeley DB | Optional, wallet storage (only needed when wallet enabled)
4747
qt | GUI | GUI toolkit (only needed when GUI enabled)
4848
libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled)
4949
libzmq3 | ZMQ notification | Optional, allows generating ZMQ notifications (requires ZMQ version >= 4.0.0)

src/qt/createwalletdialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
5757
ui->descriptor_checkbox->setEnabled(false);
5858
ui->descriptor_checkbox->setChecked(false);
5959
#endif
60+
#ifndef USE_BDB
61+
ui->descriptor_checkbox->setEnabled(false);
62+
ui->descriptor_checkbox->setChecked(true);
63+
#endif
6064
}
6165

6266
CreateWalletDialog::~CreateWalletDialog()

src/wallet/rpcwallet.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,6 +2941,11 @@ static UniValue createwallet(const JSONRPCRequest& request)
29412941
warnings.emplace_back(Untranslated("Wallet is an experimental descriptor wallet"));
29422942
}
29432943

2944+
#ifndef USE_BDB
2945+
if (!(flags & WALLET_FLAG_DESCRIPTORS)) {
2946+
throw JSONRPCError(RPC_WALLET_ERROR, "Compiled without bdb support (required for legacy wallets)");
2947+
}
2948+
#endif
29442949
DatabaseOptions options;
29452950
DatabaseStatus status;
29462951
options.require_create = true;

0 commit comments

Comments
 (0)