Merge bitcoin/bitcoin#24364: refactor: remove duplicate code from BlockAssembler

0f40d65321 refactor: remove duplicate code from BlockAssembler (James O'Beirne)

Pull request description:

  Found while reminding myself how transactions are chosen for blocks. Take it or leave it!

ACKs for top commit:
  glozow:
    ACK 0f40d65321
  theStack:
    Concept and code-review ACK 0f40d65321

Tree-SHA512: 8a2694e670ce3fe897ab8f64f64c8df5f8487fc1264527a3abbcba0e5b921fb693416497ccd62508295bc33f202c65556b91b6af463acb91aab43138d2492c14
pull/25666/head
glozow 2 years ago
commit 292f652d53
No known key found for this signature in database
GPG Key ID: BA03F4DBE0C63FB4

@ -257,13 +257,9 @@ static int UpdatePackagesForAdded(const CTxMemPool& mempool,
modtxiter mit = mapModifiedTx.find(desc);
if (mit == mapModifiedTx.end()) {
CTxMemPoolModifiedEntry modEntry(desc);
modEntry.nSizeWithAncestors -= it->GetTxSize();
modEntry.nModFeesWithAncestors -= it->GetModifiedFee();
modEntry.nSigOpCostWithAncestors -= it->GetSigOpCost();
mapModifiedTx.insert(modEntry);
} else {
mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
mit = mapModifiedTx.insert(modEntry).first;
}
mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
}
}
return nDescendantsUpdated;

Loading…
Cancel
Save