diff options
author | Kiminuo <kiminuo@protonmail.com> | 2020-06-11 08:58:46 +0200 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-02-03 18:35:52 +0800 |
commit | 41d7166c8a598b604aad6c6b1d88ad46e23be247 (patch) | |
tree | 883af805ab387dc7db01602a19ccd70d89b78cb1 /src/wallet/wallet.cpp | |
parent | ffc89d1f21258553c0087b774a9ea1ce84139d4f (diff) |
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/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 84962af906..7e694d1987 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -378,7 +378,7 @@ std::shared_ptr<CWallet> RestoreWallet(WalletContext& context, const fs::path& b } auto wallet_file = wallet_path / "wallet.dat"; - fs::copy_file(backup_file, wallet_file, fs::copy_option::fail_if_exists); + fs::copy_file(backup_file, wallet_file, fs::copy_options::none); auto wallet = LoadWallet(context, wallet_name, load_on_start, options, status, error, warnings); @@ -2651,9 +2651,9 @@ std::unique_ptr<WalletDatabase> MakeWalletDatabase(const std::string& name, cons // 4. For backwards compatibility, the name of a data file in -walletdir. const fs::path wallet_path = fsbridge::AbsPathJoin(GetWalletDir(), fs::PathFromString(name)); fs::file_type path_type = fs::symlink_status(wallet_path).type(); - if (!(path_type == fs::file_not_found || path_type == fs::directory_file || - (path_type == fs::symlink_file && fs::is_directory(wallet_path)) || - (path_type == fs::regular_file && fs::PathFromString(name).filename() == fs::PathFromString(name)))) { + if (!(path_type == fs::file_type::not_found || path_type == fs::file_type::directory || + (path_type == fs::file_type::symlink && fs::is_directory(wallet_path)) || + (path_type == fs::file_type::regular && fs::PathFromString(name).filename() == fs::PathFromString(name)))) { error_string = Untranslated(strprintf( "Invalid -wallet path '%s'. -wallet path should point to a directory where wallet.dat and " "database/log.?????????? files can be stored, a location where such a directory could be created, " |