refactor: remove duplicate code from BlockAssembler #24364

pull jamesob wants to merge 1 commits into bitcoin:master from jamesob:2022-02-ba-dup-code changing 1 files +2 −6
  1. jamesob commented at 2:19 AM on February 17, 2022: member

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

  2. refactor: remove duplicate code from BlockAssembler 0f40d65321
  3. DrahtBot added the label Refactoring on Feb 17, 2022
  4. laanwj commented at 4:22 PM on February 23, 2022: member

    Concept ACK

  5. theStack approved
  6. theStack commented at 10:19 AM on March 1, 2022: contributor

    Concept and code-review ACK 0f40d653218789aa176ca2f844e3222d2ad890a3

  7. glozow commented at 1:21 PM on March 1, 2022: member

    code review ACK 0f40d653218789aa176ca2f844e3222d2ad890a3

  8. fanquake added this to the milestone 24.0 on Mar 2, 2022
  9. maflcko commented at 4:18 PM on March 8, 2022: member

    Can anyone explain why this is correct? Why should GetModifiedFee be equal to GetFee??

  10. jamesob commented at 4:24 PM on March 8, 2022: member

    Can anyone explain why this is correct? Why should GetModifiedFee be equal to GetFee??

    Good point. This is not correct. :)

    Probably a comment and/or test should be added.

  11. jamesob closed this on Mar 8, 2022

  12. glozow commented at 4:26 PM on March 8, 2022: member

    Ah that's true, but it's very weird that they're not the same. Why does update_for_parent_inclusion use GetFee() and not GetModifiedFee() to update nModFeesWithAncestors?

  13. maflcko commented at 4:34 PM on March 8, 2022: member

    <strike>modified fee is already applied recursively, so if you apply it repeatedly it would accumulate?</strike>

    Edit: This is nonsense

  14. glozow commented at 4:40 PM on March 8, 2022: member

    What do you mean by recursively? Isn't nModFeesWithAncestors the sum of ours + all ancestors' modified fees? So if you're updating for parent inclusion, using parent.GetFee() instead of parent.GetModifiedFee() means you're still including the prioritisation from your parent, which would be incorrect.

  15. theStack commented at 5:29 PM on March 8, 2022: contributor

    Can anyone explain why this is correct? Why should GetModifiedFee be equal to GetFee??

    Oh snap, I obviously totally overlooked this in my review :/

  16. glozow cross-referenced this on Mar 11, 2022 from issue miner: bug fix? update for ancestor inclusion using modified fees, not base by glozow
  17. jamesob cross-referenced this on Mar 25, 2022 from issue test: Add diamond-shape prioritisetransaction test by maflcko
  18. maflcko commented at 9:07 AM on May 6, 2022: member

    This can be reopened, now that #https://github.com/bitcoin/bitcoin/pull/24538 is merged.

  19. maflcko referenced this in commit b2e7811c62 on May 6, 2022
  20. sidhujag referenced this in commit c8d2687323 on May 9, 2022
  21. fanquake commented at 2:45 PM on September 13, 2022: member

    @jamesob @glozow want to reopen / pick this up?

  22. fanquake removed this from the milestone 24.0 on Sep 13, 2022
  23. glozow commented at 3:10 PM on September 13, 2022: member

    Concept ACK to reopen. Agree not necessary for v24.0.

  24. jamesob reopened this on Sep 13, 2022

  25. DrahtBot commented at 1:01 PM on September 23, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  26. glozow commented at 9:57 AM on October 6, 2022: member

    ACK 0f40d653218789aa176ca2f844e3222d2ad890a3

  27. glozow merged this on Oct 6, 2022
  28. glozow closed this on Oct 6, 2022

  29. sidhujag referenced this in commit 22d943f5ee on Oct 6, 2022
  30. Fabcien referenced this in commit ce0b1b9a24 on Jan 6, 2023
  31. bitcoin locked this on Oct 6, 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-05-19 06:53 UTC