diff options
author | glozow <gloriajzhao@gmail.com> | 2022-10-06 11:28:37 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2022-10-06 12:50:33 +0100 |
commit | 292f652d53b72193a000cfd080dba4639ce02258 (patch) | |
tree | a8821886efa48fbfa28456d599866423ca44bd1a /src/node | |
parent | 5e82b9ba96b6c5614a1187382a086e5694dff544 (diff) | |
parent | 0f40d653218789aa176ca2f844e3222d2ad890a3 (diff) |
Merge bitcoin/bitcoin#24364: refactor: remove duplicate code from BlockAssembler
0f40d653218789aa176ca2f844e3222d2ad890a3 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 0f40d653218789aa176ca2f844e3222d2ad890a3
theStack:
Concept and code-review ACK 0f40d653218789aa176ca2f844e3222d2ad890a3
Tree-SHA512: 8a2694e670ce3fe897ab8f64f64c8df5f8487fc1264527a3abbcba0e5b921fb693416497ccd62508295bc33f202c65556b91b6af463acb91aab43138d2492c14
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/miner.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/node/miner.cpp b/src/node/miner.cpp index b277188c1f..4536507cd5 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -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; |