Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,110 Lines • ▼ Show 20 Lines | CWallet *CWallet::CreateWalletFromFile(const CChainParams &chainParams, | ||||
std::vector<CWalletTx> vWtx; | std::vector<CWalletTx> vWtx; | ||||
if (gArgs.GetBoolArg("-zapwallettxes", false)) { | if (gArgs.GetBoolArg("-zapwallettxes", false)) { | ||||
uiInterface.InitMessage(_("Zapping all transactions from wallet...")); | uiInterface.InitMessage(_("Zapping all transactions from wallet...")); | ||||
std::unique_ptr<CWalletDBWrapper> dbw( | std::unique_ptr<CWalletDBWrapper> dbw( | ||||
new CWalletDBWrapper(&bitdb, walletFile)); | new CWalletDBWrapper(&bitdb, walletFile)); | ||||
std::unique_ptr<CWallet> tempWallet = | std::unique_ptr<CWallet> tempWallet = | ||||
MakeUnique<CWallet>(chainParams, std::move(dbw)); | std::make_unique<CWallet>(chainParams, std::move(dbw)); | ||||
DBErrors nZapWalletRet = tempWallet->ZapWalletTx(vWtx); | DBErrors nZapWalletRet = tempWallet->ZapWalletTx(vWtx); | ||||
if (nZapWalletRet != DB_LOAD_OK) { | if (nZapWalletRet != DB_LOAD_OK) { | ||||
InitError( | InitError( | ||||
strprintf(_("Error loading %s: Wallet corrupted"), walletFile)); | strprintf(_("Error loading %s: Wallet corrupted"), walletFile)); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 287 Lines • Show Last 20 Lines |