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

Method UpdateAncestorsOf

src/txmempool.cpp:359–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359void CTxMemPool::UpdateAncestorsOf(bool add, txiter it, setEntries &setAncestors)
360{
361 const CTxMemPoolEntry::Parents& parents = it->GetMemPoolParentsConst();
362 // add or remove this tx as a child of each parent
363 for (const CTxMemPoolEntry& parent : parents) {
364 UpdateChild(mapTx.iterator_to(parent), it, add);
365 }
366 const int64_t updateCount = (add ? 1 : -1);
367 const int64_t updateSize = updateCount * it->GetTxSize();
368 const CAmount updateFee = updateCount * it->GetModifiedFee();
369 for (txiter ancestorIt : setAncestors) {
370 mapTx.modify(ancestorIt, update_descendant_state(updateSize, updateFee, updateCount));
371 }
372}
373
374void CTxMemPool::UpdateEntryForAncestors(txiter it, const setEntries &setAncestors)
375{

Callers

nothing calls this directly

Calls 3

GetTxSizeMethod · 0.45
GetModifiedFeeMethod · 0.45

Tested by

no test coverage detected