validation: remove unused code #36103

pull fanquake wants to merge 5 commits into bitcoin:master from fanquake:validation_dead_code changing 2 files +21 −36
  1. fanquake commented at 3:02 PM on August 27, 2026: member

    Remove some unused code from validation.

  2. validation: remove unused PackageMempoolAcceptResult constructor 2cb6c156e1
  3. validation: remove unused total_vsize arg from PackageRBFChecks d26dc09ee3
  4. validation: remove unused args from ConsensusScriptChecks a9d5cf7f99
  5. validation: remove unused args from PolicyScriptChecks 84c5290149
  6. DrahtBot added the label Validation on Aug 27, 2026
  7. DrahtBot commented at 3:02 PM on August 27, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36103.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK thomasbuilds, sedited, yuvicc, hebasto, jeanpablojp

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35557 (kernel, validation: Add btck_chainstate_manager_set_clock_time by ryanofsky)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  8. sedited approved
  9. sedited commented at 3:55 PM on August 27, 2026: contributor

    ACK 84c5290149a3f6d62ecebeaa064852b22db1a9f4

  10. validation: remove unused m_chainparams from ATMPArgs 15630c7b85
  11. in src/validation.cpp:458 in 84c5290149


    thomasbuilds commented at 4:15 PM on August 27, 2026:

    m_chainparams appears unused too


    thomasbuilds commented at 4:52 PM on August 27, 2026:

    update: m_chainparams has been unread since 78adef1 which switched GetBlockScriptFlags from taking Consensus::Params to ChainstateManager and deleted the field's last read. The same commit is what orphaned the args param this PR removes from ConsensusScriptChecks.


    fanquake commented at 5:06 PM on August 27, 2026:

    Thanks, I think you're correct here. Pushed up another commit.

  12. thomasbuilds commented at 5:15 PM on August 27, 2026: contributor

    ACK 15630c7

  13. DrahtBot requested review from sedited on Aug 27, 2026
  14. sedited approved
  15. sedited commented at 5:36 PM on August 27, 2026: contributor

    ACK 15630c7b852c20624fe0f5dbc46db4e869dfd331

  16. yuvicc commented at 3:57 AM on August 28, 2026: contributor

    ACK 15630c7b852c20624fe0f5dbc46db4e869dfd331

    No behavior change and removal looks good.

  17. hebasto approved
  18. hebasto commented at 7:24 AM on August 28, 2026: member

    ACK 15630c7b852c20624fe0f5dbc46db4e869dfd331, completeness of removing unused parameters in the validation module verified by overriding the -Wunused-parameter compiler flag for src/validation.cpp.

  19. jeanpablojp commented at 2:12 AM on August 30, 2026: contributor

    tACK 15630c7b852c20624fe0f5dbc46db4e869dfd331

    Built and ran the unit tests.

    Chainstate::SetTargetBlockHash has no caller either, and -Wunused-parameter doesn't catch it because it's a method, not a parameter. It landed in master already unused, in #30214, which open-coded its last call site in AddChainstate. But if you'd rather not touch this PR any further, I can open a follow-up.

  20. sedited merged this on Aug 31, 2026
  21. sedited closed this on Aug 31, 2026

  22. fanquake deleted the branch on Aug 31, 2026

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-08-31 18:51 UTC

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