fix: descriptor wallets follow-up to merge bitcoin#20202: Make BDB support optional

This commit is contained in:
Konstantin Akimov 2023-09-28 21:59:25 +07:00
parent a340ad641e
commit f6b3614754
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
3 changed files with 10 additions and 1 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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;