Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,319 Lines • ▼ Show 20 Lines | if (!(path_type == fs::file_not_found || path_type == fs::directory_file || | ||||
"where such a directory could be created, " | "where such a directory could be created, " | ||||
"or (for backwards compatibility) the name of an " | "or (for backwards compatibility) the name of an " | ||||
"existing data file in -walletdir (%s)", | "existing data file in -walletdir (%s)", | ||||
location.GetName(), GetWalletDir()); | location.GetName(), GetWalletDir()); | ||||
return false; | return false; | ||||
} | } | ||||
// Make sure that the wallet path doesn't clash with an existing wallet path | // Make sure that the wallet path doesn't clash with an existing wallet path | ||||
for (auto wallet : GetWallets()) { | if (IsWalletLoaded(wallet_path)) { | ||||
if (wallet->GetLocation().GetPath() == wallet_path) { | error_string = strprintf( | ||||
error_string = strprintf("Error loading wallet %s. Duplicate " | "Error loading wallet %s. Duplicate -wallet filename specified.", | ||||
"-wallet filename specified.", | |||||
location.GetName()); | location.GetName()); | ||||
return false; | return false; | ||||
} | } | ||||
} | |||||
try { | try { | ||||
if (!WalletBatch::VerifyEnvironment(wallet_path, error_string)) { | if (!WalletBatch::VerifyEnvironment(wallet_path, error_string)) { | ||||
return false; | return false; | ||||
} | } | ||||
} catch (const fs::filesystem_error &e) { | } catch (const fs::filesystem_error &e) { | ||||
error_string = strprintf("Error loading wallet %s. %s", | error_string = strprintf("Error loading wallet %s. %s", | ||||
location.GetName(), e.what()); | location.GetName(), e.what()); | ||||
▲ Show 20 Lines • Show All 564 Lines • Show Last 20 Lines |