Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 3,292 Lines • ▼ Show 20 Lines | bool CWallet::AddAccountingEntry(const CAccountingEntry &acentry, | ||||
laccentries.push_back(acentry); | laccentries.push_back(acentry); | ||||
CAccountingEntry &entry = laccentries.back(); | CAccountingEntry &entry = laccentries.back(); | ||||
wtxOrdered.insert(std::make_pair(entry.nOrderPos, TxPair(nullptr, &entry))); | wtxOrdered.insert(std::make_pair(entry.nOrderPos, TxPair(nullptr, &entry))); | ||||
return true; | return true; | ||||
} | } | ||||
DBErrors CWallet::LoadWallet(bool &fFirstRunRet) { | DBErrors CWallet::LoadWallet(bool &fFirstRunRet) { | ||||
LOCK2(cs_main, cs_wallet); | |||||
fFirstRunRet = false; | fFirstRunRet = false; | ||||
DBErrors nLoadWalletRet = CWalletDB(*dbw, "cr+").LoadWallet(this); | DBErrors nLoadWalletRet = CWalletDB(*dbw, "cr+").LoadWallet(this); | ||||
if (nLoadWalletRet == DB_NEED_REWRITE) { | if (nLoadWalletRet == DB_NEED_REWRITE) { | ||||
if (dbw->Rewrite("\x04pool")) { | if (dbw->Rewrite("\x04pool")) { | ||||
LOCK(cs_wallet); | |||||
setInternalKeyPool.clear(); | setInternalKeyPool.clear(); | ||||
setExternalKeyPool.clear(); | setExternalKeyPool.clear(); | ||||
m_pool_key_to_index.clear(); | m_pool_key_to_index.clear(); | ||||
// Note: can't top-up keypool here, because wallet is locked. | // Note: can't top-up keypool here, because wallet is locked. | ||||
// User will be prompted to unlock wallet the next operation | // User will be prompted to unlock wallet the next operation | ||||
// that requires a new key. | // that requires a new key. | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,139 Lines • Show Last 20 Lines |