MCPcopy Create free account
hub / github.com/LUX-Core/lux / UpdatePackagesForAdded

Method UpdatePackagesForAdded

src/miner.cpp:778–800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778void BlockAssembler::UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded,
779 indexed_modified_transaction_set &mapModifiedTx)
780{
781 for (const CTxMemPool::txiter it : alreadyAdded) {
782 CTxMemPool::setEntries descendants;
783 mempool.CalculateDescendants(it, descendants);
784 // Insert all descendants (not yet in block) into the modified set
785 for (CTxMemPool::txiter desc : descendants) {
786 if (alreadyAdded.count(desc))
787 continue;
788 modtxiter mit = mapModifiedTx.find(desc);
789 if (mit == mapModifiedTx.end()) {
790 CTxMemPoolModifiedEntry modEntry(desc);
791 modEntry.nSizeWithAncestors -= it->GetTxSize();
792 modEntry.nModFeesWithAncestors -= it->GetModifiedFee();
793 modEntry.nSigOpCostWithAncestors -= it->GetSigOpCost();
794 mapModifiedTx.insert(modEntry);
795 } else {
796 mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
797 }
798 }
799 }
800}
801
802// Skip entries in mapTx that are already in a block or are present
803// 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