| 302 | } |
| 303 | |
| 304 | int BlockAssembler::UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded, |
| 305 | indexed_modified_transaction_set &mapModifiedTx) |
| 306 | { |
| 307 | AssertLockHeld(m_mempool.cs); |
| 308 | |
| 309 | int nDescendantsUpdated = 0; |
| 310 | for (CTxMemPool::txiter it : alreadyAdded) { |
| 311 | CTxMemPool::setEntries descendants; |
| 312 | m_mempool.CalculateDescendants(it, descendants); |
| 313 | // Insert all descendants (not yet in block) into the modified set |
| 314 | for (CTxMemPool::txiter desc : descendants) { |
| 315 | if (alreadyAdded.count(desc)) { |
| 316 | continue; |
| 317 | } |
| 318 | ++nDescendantsUpdated; |
| 319 | modtxiter mit = mapModifiedTx.find(desc); |
| 320 | if (mit == mapModifiedTx.end()) { |
| 321 | CTxMemPoolModifiedEntry modEntry(desc); |
| 322 | modEntry.nSizeWithAncestors -= it->GetTxSize(); |
| 323 | modEntry.discountSizeWithAncestors -= it->GetDiscountTxSize(); |
| 324 | modEntry.nModFeesWithAncestors -= it->GetModifiedFee(); |
| 325 | modEntry.nSigOpCostWithAncestors -= it->GetSigOpCost(); |
| 326 | mapModifiedTx.insert(modEntry); |
| 327 | } else { |
| 328 | mapModifiedTx.modify(mit, update_for_parent_inclusion(it)); |
| 329 | } |
| 330 | } |
| 331 | } |
| 332 | return nDescendantsUpdated; |
| 333 | } |
| 334 | |
| 335 | // Skip entries in mapTx that are already in a block or are present |
| 336 | // in mapModifiedTx (which implies that the mapTx ancestor state is |
nothing calls this directly
no test coverage detected