diff options
author | Ava Chow <github@achow101.com> | 2024-01-02 16:36:17 -0500 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-05-16 15:03:13 -0400 |
commit | 70cfbfdadf16d3b115309c6938f07ef5b96c7cc1 (patch) | |
tree | c197e461695ca6559e95649b9473cae1b43db399 /src/wallet/wallettool.cpp | |
parent | dd57713f6ede3d46e97ee7df87c10001b0bf4c3d (diff) | |
download | bitcoin-70cfbfdadf16d3b115309c6938f07ef5b96c7cc1.tar.xz |
wallettool: Optionally use BERKELEY_RO as format when dumping BDB wallets
In order to ease the transition to not having BDB, make the dump tool
use DatabaseFormmat::BERKELEY_RO when -withinternalbdb is set.
Diffstat (limited to 'src/wallet/wallettool.cpp')
-rw-r--r-- | src/wallet/wallettool.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/wallettool.cpp b/src/wallet/wallettool.cpp index cda344ab19..56868272bb 100644 --- a/src/wallet/wallettool.cpp +++ b/src/wallet/wallettool.cpp @@ -194,6 +194,11 @@ bool ExecuteWalletToolFunc(const ArgsManager& args, const std::string& command) ReadDatabaseArgs(args, options); options.require_existing = true; DatabaseStatus status; + + if (args.GetBoolArg("-withinternalbdb", false) && IsBDBFile(BDBDataFile(path))) { + options.require_format = DatabaseFormat::BERKELEY_RO; + } + bilingual_str error; std::unique_ptr<WalletDatabase> database = MakeDatabase(path, options, status, error); if (!database) { |