Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,274 Lines • ▼ Show 20 Lines | for (auto wallet : GetWallets()) { | ||||
if (fs::absolute(wallet->GetName(), GetWalletDir()) == wallet_path) { | if (fs::absolute(wallet->GetName(), GetWalletDir()) == wallet_path) { | ||||
error_string = strprintf("Error loading wallet %s. Duplicate " | error_string = strprintf("Error loading wallet %s. Duplicate " | ||||
"-wallet filename specified.", | "-wallet filename specified.", | ||||
wallet_file); | wallet_file); | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
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) { | |||||
error_string = | |||||
strprintf("Error loading wallet %s. %s", wallet_file, e.what()); | |||||
return false; | |||||
} | |||||
if (salvage_wallet) { | if (salvage_wallet) { | ||||
// Recover readable keypairs: | // Recover readable keypairs: | ||||
CWallet dummyWallet(chainParams, "dummy", | CWallet dummyWallet(chainParams, "dummy", | ||||
WalletDatabase::CreateDummy()); | WalletDatabase::CreateDummy()); | ||||
std::string backup_filename; | std::string backup_filename; | ||||
if (!WalletBatch::Recover( | if (!WalletBatch::Recover( | ||||
wallet_path, static_cast<void *>(&dummyWallet), | wallet_path, static_cast<void *>(&dummyWallet), | ||||
▲ Show 20 Lines • Show All 476 Lines • Show Last 20 Lines |