#36071 refactor: fuzz: remove cost_of_change from coin-grinder fuzz target

full analysis

https://github.com/bitcoin/bitcoin/pull/36071 · yancyribbens · +0/-1 in 1 files, 1 commits · labels: Refactoring

Goal

  • Clean up dead setup code in wallet coin-grinder fuzz tests
  • Avoid setting an unused parameter that has no effect on the algorithm

Removes an unused assignment to `coin_params.m_cost_of_change` from the `coin_grinder` fuzz harness in `src/wallet/test/fuzz/coinselection.cpp`. The coin-grinder selection algorithm does not use that parameter.

Problem: The fuzz test harness sets a variable that is ignored by the coin-grinder algorithm, leaving dead setup code in the test.

Category: Wallet (#81 of 84)

P4 · cleanup

  • P4 because it is a minor cleanup in test code
  • Has no functional impact on wallet logic or fuzzing efficacy

P4 as a minor cleanup in test code. As brunoerg noted, the assignment is a no-op in this target, so removing it has no functional impact on wallet logic or fuzzing efficacy.

Membership: Modifies the wallet coin selection fuzz harness in `src/wallet/test/fuzz/coinselection.cpp`.

Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0

Reviewability: Ready

  • Ready for review now
  • Single-line test cleanup with no conflicts or failing checks

The change is a single-line test cleanup with no conflicts or failing checks.

Author status: silent since submission on 2026-08-24

Agreement: Strong

  • Approved confirming the assignment is dead code and a no-op in the target (brunoerg)

Approved with rationale confirming the assignment is dead code (brunoerg)

brunoerg confirmed that `m_cost_of_change` is unused by coin-grinder and approved the removal.

  • brunoerg ACKed: 'm_cost_of_change isn't used for anything of coin-grinder, it's a no-op in the target and it's fine to remove it.'

Review verdicts (DrahtBot): 1

Files

1 lines under test/bench/ci.

  • src/wallet/test/fuzz/coinselection.cpp +0/-1

Card

PR 36071 removes an unused assignment of `m_cost_of_change` from the `coin_grinder` fuzz target in wallet tests. The coin-grinder algorithm does not consume that parameter, making the setup dead code. This is a minor test cleanup with no user-facing impact or change to fuzzing coverage. Review is ready and approved by one reviewer with no objections.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:57, confidence high, input hash 8a76f32c06ef1558