|
|
@ -468,13 +468,24 @@ bool CWallet::Verify() |
|
|
|
|
|
|
|
|
|
|
|
uiInterface.InitMessage(_("Verifying wallet(s)...")); |
|
|
|
uiInterface.InitMessage(_("Verifying wallet(s)...")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Keep track of each wallet absolute path to detect duplicates.
|
|
|
|
|
|
|
|
std::set<fs::path> wallet_paths; |
|
|
|
|
|
|
|
|
|
|
|
for (const std::string& walletFile : gArgs.GetArgs("-wallet")) { |
|
|
|
for (const std::string& walletFile : gArgs.GetArgs("-wallet")) { |
|
|
|
if (boost::filesystem::path(walletFile).filename() != walletFile) { |
|
|
|
if (boost::filesystem::path(walletFile).filename() != walletFile) { |
|
|
|
return InitError(_("-wallet parameter must only specify a filename (not a path)")); |
|
|
|
return InitError(_("-wallet parameter must only specify a filename (not a path)")); |
|
|
|
} else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) { |
|
|
|
return InitError(_("Invalid characters in -wallet filename")); |
|
|
|
return InitError(_("Invalid characters in -wallet filename")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fs::path wallet_path = fs::absolute(walletFile, GetDataDir()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!wallet_paths.insert(wallet_path).second) { |
|
|
|
|
|
|
|
return InitError(_("Duplicate -wallet filename")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::string strError; |
|
|
|
std::string strError; |
|
|
|
if (!CWalletDB::VerifyEnvironment(walletFile, GetDataDir().string(), strError)) { |
|
|
|
if (!CWalletDB::VerifyEnvironment(walletFile, GetDataDir().string(), strError)) { |
|
|
|
return InitError(strError); |
|
|
|
return InitError(strError); |
|
|
|