Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 334 Lines • ▼ Show 20 Lines | for (const std::string &walletFile : gArgs.GetArgs("-wallet")) { | ||||
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."), | ||||
walletFile)); | walletFile)); | ||||
} | } | ||||
std::string strError; | std::string strError; | ||||
if (!CWalletDB::VerifyEnvironment(wallet_path, strError)) { | if (!WalletBatch::VerifyEnvironment(wallet_path, strError)) { | ||||
return InitError(strError); | return InitError(strError); | ||||
} | } | ||||
if (gArgs.GetBoolArg("-salvagewallet", false)) { | if (gArgs.GetBoolArg("-salvagewallet", false)) { | ||||
// Recover readable keypairs: | // Recover readable keypairs: | ||||
CWallet dummyWallet(chainParams, "dummy", | CWallet dummyWallet(chainParams, "dummy", | ||||
CWalletDBWrapper::CreateDummy()); | WalletDatabase::CreateDummy()); | ||||
std::string backup_filename; | std::string backup_filename; | ||||
if (!CWalletDB::Recover(wallet_path, (void *)&dummyWallet, | if (!WalletBatch::Recover(wallet_path, (void *)&dummyWallet, | ||||
CWalletDB::RecoverKeysOnlyFilter, | WalletBatch::RecoverKeysOnlyFilter, | ||||
backup_filename)) { | backup_filename)) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
std::string strWarning; | std::string strWarning; | ||||
bool dbV = | bool dbV = | ||||
CWalletDB::VerifyDatabaseFile(wallet_path, strWarning, strError); | WalletBatch::VerifyDatabaseFile(wallet_path, strWarning, strError); | ||||
if (!strWarning.empty()) { | if (!strWarning.empty()) { | ||||
InitWarning(strWarning); | InitWarning(strWarning); | ||||
} | } | ||||
if (!dbV) { | if (!dbV) { | ||||
InitError(strError); | InitError(strError); | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |