MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / removeForBlock

Method removeForBlock

src/kernel/disconnected_transactions.cpp:61–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void DisconnectedBlockTransactions::removeForBlock(const std::vector<CTransactionRef>& vtx)
62{
63 // Short-circuit in the common case of a block being added to the tip
64 if (queuedTx.empty()) {
65 return;
66 }
67 for (const auto& tx : vtx) {
68 auto iter = iters_by_txid.find(tx->GetHash());
69 if (iter != iters_by_txid.end()) {
70 auto list_iter = iter->second;
71 iters_by_txid.erase(iter);
72 cachedInnerUsage -= RecursiveDynamicUsage(*list_iter);
73 queuedTx.erase(list_iter);
74 }
75 }
76}
77
78void DisconnectedBlockTransactions::clear()
79{

Callers 6

BOOST_AUTO_TEST_CASEFunction · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
FinishFunction · 0.45
ComplexMemPoolFunction · 0.45
ReorgFunction · 0.45

Calls 6

RecursiveDynamicUsageFunction · 0.85
findMethod · 0.80
emptyMethod · 0.45
GetHashMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by 4

BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
FinishFunction · 0.36