aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/dump.cpp
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-01-02 16:36:17 -0500
committerAva Chow <github@achow101.com>2024-05-16 15:03:13 -0400
commit70cfbfdadf16d3b115309c6938f07ef5b96c7cc1 (patch)
treec197e461695ca6559e95649b9473cae1b43db399 /src/wallet/dump.cpp
parentdd57713f6ede3d46e97ee7df87c10001b0bf4c3d (diff)
downloadbitcoin-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/dump.cpp')
-rw-r--r--src/wallet/dump.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wallet/dump.cpp b/src/wallet/dump.cpp
index 7a36910dc1..970830754d 100644
--- a/src/wallet/dump.cpp
+++ b/src/wallet/dump.cpp
@@ -60,7 +60,13 @@ bool DumpWallet(const ArgsManager& args, WalletDatabase& db, bilingual_str& erro
hasher << Span{line};
// Write out the file format
- line = strprintf("%s,%s\n", "format", db.Format());
+ std::string format = db.Format();
+ // BDB files that are opened using BerkeleyRODatabase have it's format as "bdb_ro"
+ // We want to override that format back to "bdb"
+ if (format == "bdb_ro") {
+ format = "bdb";
+ }
+ line = strprintf("%s,%s\n", "format", format);
dump_file.write(line.data(), line.size());
hasher << Span{line};