Skip to content

Commit 292f652

Browse files
committed
Merge bitcoin#24364: refactor: remove duplicate code from BlockAssembler
0f40d65 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 0f40d65 theStack: Concept and code-review ACK 0f40d65 Tree-SHA512: 8a2694e670ce3fe897ab8f64f64c8df5f8487fc1264527a3abbcba0e5b921fb693416497ccd62508295bc33f202c65556b91b6af463acb91aab43138d2492c14
2 parents 5e82b9b + 0f40d65 commit 292f652

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/node/miner.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,9 @@ static int UpdatePackagesForAdded(const CTxMemPool& mempool,
257257
modtxiter mit = mapModifiedTx.find(desc);
258258
if (mit == mapModifiedTx.end()) {
259259
CTxMemPoolModifiedEntry modEntry(desc);
260-
modEntry.nSizeWithAncestors -= it->GetTxSize();
261-
modEntry.nModFeesWithAncestors -= it->GetModifiedFee();
262-
modEntry.nSigOpCostWithAncestors -= it->GetSigOpCost();
263-
mapModifiedTx.insert(modEntry);
264-
} else {
265-
mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
260+
mit = mapModifiedTx.insert(modEntry).first;
266261
}
262+
mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
267263
}
268264
}
269265
return nDescendantsUpdated;

0 commit comments

Comments
 (0)