Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | bool WalletInit::Verify(const CChainParams &chainParams) const { | ||||
// was enabled with more than wallet file, so the wallet_files size check | // was enabled with more than wallet file, so the wallet_files size check | ||||
// here should have no effect. | // here should have no effect. | ||||
bool salvage_wallet = | bool salvage_wallet = | ||||
gArgs.GetBoolArg("-salvagewallet", false) && wallet_files.size() <= 1; | gArgs.GetBoolArg("-salvagewallet", false) && wallet_files.size() <= 1; | ||||
// Keep track of each wallet absolute path to detect duplicates. | // Keep track of each wallet absolute path to detect duplicates. | ||||
std::set<fs::path> wallet_paths; | std::set<fs::path> wallet_paths; | ||||
for (const auto wallet_file : wallet_files) { | for (const auto &wallet_file : wallet_files) { | ||||
fs::path wallet_path = fs::absolute(wallet_file, GetWalletDir()); | fs::path wallet_path = fs::absolute(wallet_file, GetWalletDir()); | ||||
if (!wallet_paths.insert(wallet_path).second) { | if (!wallet_paths.insert(wallet_path).second) { | ||||
return InitError(strprintf(_("Error loading wallet %s. Duplicate " | return InitError(strprintf(_("Error loading wallet %s. Duplicate " | ||||
"-wallet filename specified."), | "-wallet filename specified."), | ||||
wallet_file)); | wallet_file)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |