aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/dump.cpp
diff options
context:
space:
mode:
authorKiminuo <kiminuo@protonmail.com>2021-12-02 21:21:05 +0100
committerKiminuo <kiminuo@protonmail.com>2022-03-16 08:26:28 +0100
commit39b1763730177cd7d6a32fd9321da640b0d65e0e (patch)
treece8d7c83579101fb27062410ed27283ee76558b9 /src/wallet/dump.cpp
parenta7e80449c0811b361cdaea39b6bab78ca5fbf668 (diff)
downloadbitcoin-39b1763730177cd7d6a32fd9321da640b0d65e0e.tar.xz
Replace use of `ArgsManager` with `DatabaseOptions`
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src/wallet/dump.cpp')
-rw-r--r--src/wallet/dump.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/wallet/dump.cpp b/src/wallet/dump.cpp
index 6d8508fc72..d80c3e25b0 100644
--- a/src/wallet/dump.cpp
+++ b/src/wallet/dump.cpp
@@ -19,10 +19,10 @@ namespace wallet {
static const std::string DUMP_MAGIC = "BITCOIN_CORE_WALLET_DUMP";
uint32_t DUMP_VERSION = 1;
-bool DumpWallet(CWallet& wallet, bilingual_str& error)
+bool DumpWallet(const ArgsManager& args, CWallet& wallet, bilingual_str& error)
{
// Get the dumpfile
- std::string dump_filename = gArgs.GetArg("-dumpfile", "");
+ std::string dump_filename = args.GetArg("-dumpfile", "");
if (dump_filename.empty()) {
error = _("No dump file provided. To use dump, -dumpfile=<filename> must be provided.");
return false;
@@ -114,10 +114,10 @@ static void WalletToolReleaseWallet(CWallet* wallet)
delete wallet;
}
-bool CreateFromDump(const std::string& name, const fs::path& wallet_path, bilingual_str& error, std::vector<bilingual_str>& warnings)
+bool CreateFromDump(const ArgsManager& args, const std::string& name, const fs::path& wallet_path, bilingual_str& error, std::vector<bilingual_str>& warnings)
{
// Get the dumpfile
- std::string dump_filename = gArgs.GetArg("-dumpfile", "");
+ std::string dump_filename = args.GetArg("-dumpfile", "");
if (dump_filename.empty()) {
error = _("No dump file provided. To use createfromdump, -dumpfile=<filename> must be provided.");
return false;
@@ -171,7 +171,7 @@ bool CreateFromDump(const std::string& name, const fs::path& wallet_path, biling
return false;
}
// Get the data file format with format_value as the default
- std::string file_format = gArgs.GetArg("-format", format_value);
+ std::string file_format = args.GetArg("-format", format_value);
if (file_format.empty()) {
error = _("No wallet file format provided. To use createfromdump, -format=<format> must be provided.");
return false;
@@ -193,6 +193,7 @@ bool CreateFromDump(const std::string& name, const fs::path& wallet_path, biling
DatabaseOptions options;
DatabaseStatus status;
+ ReadDatabaseArgs(args, options);
options.require_create = true;
options.require_format = data_format;
std::unique_ptr<WalletDatabase> database = MakeDatabase(wallet_path, options, status, error);