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

Method AddTransactionsFromBlock

src/kernel/disconnected_transactions.cpp:49–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49[[nodiscard]] std::vector<CTransactionRef> DisconnectedBlockTransactions::AddTransactionsFromBlock(const std::vector<CTransactionRef>& vtx)
50{
51 iters_by_txid.reserve(iters_by_txid.size() + vtx.size());
52 for (auto block_it = vtx.rbegin(); block_it != vtx.rend(); ++block_it) {
53 auto it = queuedTx.insert(queuedTx.end(), *block_it);
54 auto [_, inserted] = iters_by_txid.emplace((*block_it)->GetHash(), it);
55 assert(inserted); // callers may never pass multiple transactions with the same txid
56 cachedInnerUsage += RecursiveDynamicUsage(*block_it);
57 }
58 return LimitMemoryUsage();
59}
60
61void DisconnectedBlockTransactions::removeForBlock(const std::vector<CTransactionRef>& vtx)
62{

Callers 3

DisconnectTipMethod · 0.80
BOOST_FIXTURE_TEST_CASEFunction · 0.80
ReorgFunction · 0.80

Calls 9

RecursiveDynamicUsageFunction · 0.85
rbeginMethod · 0.80
rendMethod · 0.80
emplaceMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
GetHashMethod · 0.45

Tested by 1

BOOST_FIXTURE_TEST_CASEFunction · 0.64