diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-09-28 16:50:18 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-10-25 12:33:26 +0100 |
commit | 65f3672f3b82a6fa30e5171f85bc8d8a29e0797e (patch) | |
tree | 5720ff98218142d22cd4ac3073da74e5927e3729 /src/wallet/init.cpp | |
parent | 01a4c095c87500650663341533f000c6b613e9da (diff) |
wallet: Refactor to use WalletLocation
Diffstat (limited to 'src/wallet/init.cpp')
-rw-r--r-- | src/wallet/init.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index 46983642f0..ad22fe4a58 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -211,15 +211,15 @@ bool WalletInit::Verify() const std::set<fs::path> wallet_paths; for (const auto& wallet_file : wallet_files) { - fs::path wallet_path = fs::absolute(wallet_file, GetWalletDir()); + WalletLocation location(wallet_file); - if (!wallet_paths.insert(wallet_path).second) { + if (!wallet_paths.insert(location.GetPath()).second) { return InitError(strprintf(_("Error loading wallet %s. Duplicate -wallet filename specified."), wallet_file)); } std::string error_string; std::string warning_string; - bool verify_success = CWallet::Verify(wallet_file, salvage_wallet, error_string, warning_string); + bool verify_success = CWallet::Verify(location, salvage_wallet, error_string, warning_string); if (!error_string.empty()) InitError(error_string); if (!warning_string.empty()) InitWarning(warning_string); if (!verify_success) return false; @@ -236,7 +236,7 @@ bool WalletInit::Open() const } for (const std::string& walletFile : gArgs.GetArgs("-wallet")) { - std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(walletFile, fs::absolute(walletFile, GetWalletDir())); + std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(WalletLocation(walletFile)); if (!pwallet) { return false; } |