MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / UpdatePackagesForAdded

Method UpdatePackagesForAdded

src/miner.cpp:257–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257int BlockAssembler::UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded,
258 indexed_modified_transaction_set &mapModifiedTx)
259{
260 int nDescendantsUpdated = 0;
261 for (CTxMemPool::txiter it : alreadyAdded) {
262 CTxMemPool::setEntries descendants;
263 mempool.CalculateDescendants(it, descendants);
264 // Insert all descendants (not yet in block) into the modified set
265 for (CTxMemPool::txiter desc : descendants) {
266 if (alreadyAdded.count(desc))
267 continue;
268 ++nDescendantsUpdated;
269 modtxiter mit = mapModifiedTx.find(desc);
270 if (mit == mapModifiedTx.end()) {
271 CTxMemPoolModifiedEntry modEntry(desc);
272 modEntry.nSizeWithAncestors -= it->GetTxSize();
273 modEntry.nModFeesWithAncestors -= it->GetModifiedFee();
274 modEntry.nSigOpCostWithAncestors -= it->GetSigOpCost();
275 mapModifiedTx.insert(modEntry);
276 } else {
277 mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
278 }
279 }
280 }
281 return nDescendantsUpdated;
282}
283
284// Skip entries in mapTx that are already in a block or are present
285// in mapModifiedTx (which implies that the mapTx ancestor state is

Callers

nothing calls this directly

Calls 9

CalculateDescendantsMethod · 0.80
GetSigOpCostMethod · 0.80
countMethod · 0.45
findMethod · 0.45
endMethod · 0.45
GetTxSizeMethod · 0.45
GetModifiedFeeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected