This PR is an optional prerequisite for bitcoin/bitcoin#20744 “Use std::filesystem. Remove Boost Filesystem & System” which:
- makes further code changes safer
- prevents some test failures on native Windows
There is no change in behavior. This just helps prepare for the
transition from boost::filesystem to std::filesystem by avoiding
copy_file calls that will be unsafe after the transition to
std::filesystem to due lack of a boost::filesystem::path::imbue
equivalent and inability to set a predictable locale.
`fs::path` looks more native than `std::string` for a parameter which
represents a backup file. This change eliminates back-and-forth type
conversions.
326@@ -326,7 +327,7 @@ class WalletLoader : public ChainClient
327 virtual std::string getWalletDir() = 0;
328
329 //! Restore backup wallet
330- virtual std::unique_ptr<Wallet> restoreWallet(const std::string& backup_file, const std::string& wallet_name, bilingual_str& error, std::vector<bilingual_str>& warnings) = 0;
331+ virtual std::unique_ptr<Wallet> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, bilingual_str& error, std::vector<bilingual_str>& warnings) = 0;
In commit “Change type of backup_file
parameter in RestoreWallet/restoreWallet” (3a45dc36a663ea67f13e7d5c413518b9385ec594)
Hmm, interesting that this method doesn’t seem to be called anywhere. I guess whatever PR which will use it will also need to be updated.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.