Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,326 Lines • ▼ Show 20 Lines | bool CWallet::Verify(const CChainParams &chainParams, | ||||
// 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 | ||||
if (IsWalletLoaded(wallet_path)) { | if (IsWalletLoaded(wallet_path)) { | ||||
error_string = strprintf( | error_string = strprintf( | ||||
"Error loading wallet %s. Duplicate -wallet filename specified.", | "Error loading wallet %s. Duplicate -wallet filename specified.", | ||||
location.GetName()); | location.GetName()); | ||||
return false; | return false; | ||||
} | } | ||||
// Keep same database environment instance across Verify/Recover calls | |||||
// below. | |||||
std::unique_ptr<WalletDatabase> database = | |||||
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 = strprintf("Error loading wallet %s. %s", | ||||
location.GetName(), e.what()); | location.GetName(), e.what()); | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 563 Lines • Show Last 20 Lines |