Skip to content

Commit 57bf125

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#24934: refactor, miner: Delete call to UpdatePackagesForAdded at beginning of addPackageTxs
7036cf5 Delete UpdatePackagesForAdded at beginning of addPackageTxs. (KevinMusgrave) Pull request description: In `CreateNewBlock` (in miner.cpp), `inBlock` is cleared before `addPackageTxs`, so `inBlock` will be empty in the first call to `UpdatePackagesForAdded`. I saw this brought up in these [PR review club logs](https://bitcoincore.reviews/24538) and there didn't seem to be a definitive answer for why the call is necessary. There's also an [old PR](bitcoin/bitcoin#10200) where this change was going to be applied, but it got closed. If `addPackageTxs` can be called when `inBlock` is not empty, then maybe a test should be added for that case. All the tests seem to pass with this deletion. ACKs for top commit: glozow: utACK 7036cf5 Tree-SHA512: 9e757b71b9035f68a0c6fef229b8cd83f1bdbe23f05bb02cc1bab8c3c177805b388bceb2bb1f0bce354791ccb29f351a6c51979b96ffe4d9fc6c978f83e36afc
2 parents 66bb4df + 7036cf5 commit 57bf125

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/node/miner.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,6 @@ void BlockAssembler::addPackageTxs(int& nPackagesSelected, int& nDescendantsUpda
310310
// Keep track of entries that failed inclusion, to avoid duplicate work
311311
CTxMemPool::setEntries failedTx;
312312

313-
// Start by adding all descendants of previously added txs to mapModifiedTx
314-
// and modifying them for their already included ancestors
315-
UpdatePackagesForAdded(inBlock, mapModifiedTx);
316-
317313
CTxMemPool::indexed_transaction_set::index<ancestor_score>::type::iterator mi = m_mempool.mapTx.get<ancestor_score>().begin();
318314
CTxMemPool::txiter iter;
319315

0 commit comments

Comments
 (0)