Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 3,731 Lines • ▼ Show 20 Lines | DBErrors CWallet::ZapSelectTx(std::vector<TxId> &txIdsIn, | ||||
std::vector<TxId> &txIdsOut) { | std::vector<TxId> &txIdsOut) { | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
DBErrors nZapSelectTxRet = | DBErrors nZapSelectTxRet = | ||||
WalletBatch(*database, "cr+").ZapSelectTx(txIdsIn, txIdsOut); | WalletBatch(*database, "cr+").ZapSelectTx(txIdsIn, txIdsOut); | ||||
for (const TxId &txid : txIdsOut) { | for (const TxId &txid : txIdsOut) { | ||||
const auto &it = mapWallet.find(txid); | const auto &it = mapWallet.find(txid); | ||||
wtxOrdered.erase(it->second.m_it_wtxOrdered); | wtxOrdered.erase(it->second.m_it_wtxOrdered); | ||||
mapWallet.erase(it); | mapWallet.erase(it); | ||||
NotifyTransactionChanged(this, txid, CT_DELETED); | |||||
} | } | ||||
if (nZapSelectTxRet == DBErrors::NEED_REWRITE) { | if (nZapSelectTxRet == DBErrors::NEED_REWRITE) { | ||||
if (database->Rewrite("\x04pool")) { | if (database->Rewrite("\x04pool")) { | ||||
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. | ||||
▲ Show 20 Lines • Show All 1,707 Lines • Show Last 20 Lines |