aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/dump.cpp
diff options
context:
space:
mode:
authorKiminuo <kiminuo@protonmail.com>2020-06-11 08:58:46 +0200
committerfanquake <fanquake@gmail.com>2022-02-03 18:35:52 +0800
commit41d7166c8a598b604aad6c6b1d88ad46e23be247 (patch)
tree883af805ab387dc7db01602a19ccd70d89b78cb1 /src/wallet/dump.cpp
parentffc89d1f21258553c0087b774a9ea1ce84139d4f (diff)
downloadbitcoin-41d7166c8a598b604aad6c6b1d88ad46e23be247.tar.xz
refactor: replace boost::filesystem with std::filesystem
Warning: Replacing fs::system_complete calls with fs::absolute calls in this commit may cause minor changes in behaviour because fs::absolute no longer strips trailing slashes; however these changes are believed to be safe. Co-authored-by: Russell Yanofsky <russ@yanofsky.org> Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Diffstat (limited to 'src/wallet/dump.cpp')
-rw-r--r--src/wallet/dump.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wallet/dump.cpp b/src/wallet/dump.cpp
index 3e34a2f776..6d8508fc72 100644
--- a/src/wallet/dump.cpp
+++ b/src/wallet/dump.cpp
@@ -4,9 +4,17 @@
#include <wallet/dump.h>
+#include <fs.h>
#include <util/translation.h>
#include <wallet/wallet.h>
+#include <algorithm>
+#include <fstream>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
namespace wallet {
static const std::string DUMP_MAGIC = "BITCOIN_CORE_WALLET_DUMP";
uint32_t DUMP_VERSION = 1;
@@ -26,7 +34,7 @@ bool DumpWallet(CWallet& wallet, bilingual_str& error)
error = strprintf(_("File %s already exists. If you are sure this is what you want, move it out of the way first."), fs::PathToString(path));
return false;
}
- fsbridge::ofstream dump_file;
+ std::ofstream dump_file;
dump_file.open(path);
if (dump_file.fail()) {
error = strprintf(_("Unable to open %s for writing"), fs::PathToString(path));
@@ -121,7 +129,7 @@ bool CreateFromDump(const std::string& name, const fs::path& wallet_path, biling
error = strprintf(_("Dump file %s does not exist."), fs::PathToString(dump_path));
return false;
}
- fsbridge::ifstream dump_file(dump_path);
+ std::ifstream dump_file{dump_path};
// Compute the checksum
CHashWriter hasher(0, 0);