refactor, miner: Delete call to UpdatePackagesForAdded at beginning of addPackageTxs #24934

pull KevinMusgrave wants to merge 1 commits into bitcoin:master from KevinMusgrave:2022-04-delete-UpdatePackagesForAdded changing 1 files +0 −4
  1. KevinMusgrave commented at 1:02 AM on April 21, 2022: contributor

    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 and there didn't seem to be a definitive answer for why the call is necessary. There's also an old PR 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.

  2. KevinMusgrave force-pushed on Apr 21, 2022
  3. ajtowns commented at 1:22 AM on April 21, 2022: member

    The old PR notes that "This is unnecessary now that priority transaction selection is gone." -- priority transaction selection was removed in #9602 and the line that used to add priority txs was https://github.com/bitcoin/bitcoin/pull/9602/files#diff-6bf9d2e37d503f2f3381cd3a41c26e0b9670f26c2cd4571e98d2af9e3767c1a1L170

  4. glozow commented at 9:46 PM on April 22, 2022: member

    Concept ACK 5fb15594e84112f7be35f68a843056006b725a22, thanks for providing the context. Agree this is unnecessary given the rationale in 9cea7e37158aa85119de2c81e93901da9e476ee5.

    I saw this brought up in these PR review club

    CC @mzumsande

    If addPackageTxs can be called when inBlock is not empty, then maybe a test should be added for that case.

    Given it's a private member used only by CreateNewBlock, I think it's fine to assume nobody will do this.

  5. mzumsande commented at 9:58 PM on April 22, 2022: member

    Concept ACK

    nit: remove mention of the linter from the commit message description and maybe mention above context of the removed priority transaction selection instead.

  6. Delete UpdatePackagesForAdded at beginning of addPackageTxs.
    As described in commit 9cea7e37158aa85119de2c81e93901da9e476ee5, this is no longer needed because priority transaction selection (addPriorityTxs) was removed in commit 272b25a6a99057fdcd5db5bce70b49625e973080.
    7036cf52aa
  7. KevinMusgrave force-pushed on Apr 23, 2022
  8. KevinMusgrave commented at 12:10 AM on April 23, 2022: contributor

    nit: remove mention of the linter from the commit message description and maybe mention above context of the removed priority transaction selection instead. @mzumsande Done

  9. glozow commented at 12:19 AM on April 23, 2022: member

    utACK 7036cf52aa080d2a63993c2298555252d507dd2f

  10. DrahtBot commented at 3:13 AM on May 27, 2022: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25223 ([kernel 2e/n] miner: Make mempool optional, stop constructing temporary empty mempools by dongcarl)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  11. MarcoFalke merged this on May 27, 2022
  12. MarcoFalke closed this on May 27, 2022

  13. sidhujag referenced this in commit c61ed4b1ba on May 28, 2022
  14. Fabcien referenced this in commit 449d01c1f7 on Jan 6, 2023
  15. DrahtBot locked this on May 27, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me