Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,339 Lines • ▼ Show 20 Lines | bool CWallet::Verify(const CChainParams &chainParams, interfaces::Chain &chain, | ||||
std::unique_ptr<WalletDatabase> database = | std::unique_ptr<WalletDatabase> database = | ||||
WalletDatabase::Create(wallet_path); | WalletDatabase::Create(wallet_path); | ||||
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 = | ||||
location.GetName(), e.what()); | strprintf("Error loading wallet %s. %s", location.GetName(), | ||||
fsbridge::get_filesystem_error_message(e)); | |||||
return false; | return false; | ||||
} | } | ||||
if (salvage_wallet) { | if (salvage_wallet) { | ||||
// Recover readable keypairs: | // Recover readable keypairs: | ||||
CWallet dummyWallet(chainParams, chain, WalletLocation(), | CWallet dummyWallet(chainParams, chain, WalletLocation(), | ||||
WalletDatabase::CreateDummy()); | WalletDatabase::CreateDummy()); | ||||
std::string backup_filename; | std::string backup_filename; | ||||
▲ Show 20 Lines • Show All 546 Lines • Show Last 20 Lines |