aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/load.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/load.cpp')
-rw-r--r--src/wallet/load.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wallet/load.cpp b/src/wallet/load.cpp
index 5bbc8b91f7..dde29842ec 100644
--- a/src/wallet/load.cpp
+++ b/src/wallet/load.cpp
@@ -5,6 +5,7 @@
#include <wallet/load.h>
+#include <fs.h>
#include <interfaces/chain.h>
#include <scheduler.h>
#include <util/string.h>
@@ -44,16 +45,16 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
std::set<fs::path> wallet_paths;
for (const auto& wallet_file : wallet_files) {
- WalletLocation location(wallet_file);
+ const fs::path path = fs::absolute(wallet_file, GetWalletDir());
- if (!wallet_paths.insert(location.GetPath()).second) {
+ if (!wallet_paths.insert(path).second) {
chain.initError(strprintf(_("Error loading wallet %s. Duplicate -wallet filename specified."), wallet_file));
return false;
}
bilingual_str error_string;
std::vector<bilingual_str> warnings;
- bool verify_success = CWallet::Verify(chain, location, error_string, warnings);
+ bool verify_success = CWallet::Verify(chain, wallet_file, error_string, warnings);
if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n")));
if (!verify_success) {
chain.initError(error_string);
@@ -70,7 +71,7 @@ bool LoadWallets(interfaces::Chain& chain, const std::vector<std::string>& walle
for (const std::string& walletFile : wallet_files) {
bilingual_str error;
std::vector<bilingual_str> warnings;
- std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(chain, WalletLocation(walletFile), error, warnings);
+ std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(chain, walletFile, error, warnings);
if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n")));
if (!pwallet) {
chain.initError(error);