diff options
Diffstat (limited to 'src/wallet/wallettool.cpp')
-rw-r--r-- | src/wallet/wallettool.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wallet/wallettool.cpp b/src/wallet/wallettool.cpp index cda344ab19..10785ad354 100644 --- a/src/wallet/wallettool.cpp +++ b/src/wallet/wallettool.cpp @@ -2,9 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#if defined(HAVE_CONFIG_H) -#include <config/bitcoin-config.h> -#endif +#include <config/bitcoin-config.h> // IWYU pragma: keep #include <wallet/wallettool.h> @@ -194,6 +192,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) { |