MCPcopy Create free account
hub / github.com/ElementsProject/elements / ZapSelectTx

Method ZapSelectTx

src/wallet/wallet.cpp:2364–2393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2362}
2363
2364DBErrors CWallet::ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256>& vHashOut)
2365{
2366 AssertLockHeld(cs_wallet);
2367 DBErrors nZapSelectTxRet = WalletBatch(GetDatabase()).ZapSelectTx(vHashIn, vHashOut);
2368 for (const uint256& hash : vHashOut) {
2369 const auto& it = mapWallet.find(hash);
2370 wtxOrdered.erase(it->second.m_it_wtxOrdered);
2371 for (const auto& txin : it->second.tx->vin)
2372 mapTxSpends.erase(txin.prevout);
2373 mapWallet.erase(it);
2374 NotifyTransactionChanged(hash, CT_DELETED);
2375 }
2376
2377 if (nZapSelectTxRet == DBErrors::NEED_REWRITE)
2378 {
2379 if (GetDatabase().Rewrite("\x04pool"))
2380 {
2381 for (const auto& spk_man_pair : m_spk_managers) {
2382 spk_man_pair.second->RewriteDB();
2383 }
2384 }
2385 }
2386
2387 if (nZapSelectTxRet != DBErrors::LOAD_OK)
2388 return nZapSelectTxRet;
2389
2390 MarkDirty();
2391
2392 return DBErrors::LOAD_OK;
2393}
2394
2395bool CWallet::SetAddressBookWithDB(WalletBatch& batch, const CTxDestination& address, const std::string& strName, const std::string& strPurpose)
2396{

Callers 2

BOOST_FIXTURE_TEST_CASEFunction · 0.45
removeprunedfundsFunction · 0.45

Calls 6

WalletBatchClass · 0.85
NotifyTransactionChangedFunction · 0.85
findMethod · 0.80
eraseMethod · 0.45
RewriteMethod · 0.45
RewriteDBMethod · 0.45

Tested by 1

BOOST_FIXTURE_TEST_CASEFunction · 0.36