Review report

bitcoin/bitcoin: PR #36648

1 minor finding · 1 suggestion

Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.

Findings

Link

[minor] · <iterator> is removed despite remaining std::back_inserter uses

Removing <iterator> leaves two std::back_inserter calls without their direct header and is expected to trigger the enforced IWYU job.

Location: src/script/descriptor.cpp:37 (base).

Details and suggested fix

MultisigDescriptor::Clone and TRDescriptor::Clone still use std::back_inserter, which <iterator> declares. Transitive includes may keep the file compiling, but they do not satisfy the project's direct-include requirement. src/script/*.cpp is in the enforced IWYU set, and CI runs fix_includes.py and fails on resulting diffs, so IWYU is expected to add this include back. Restore #include <iterator>. IWYU was not run for this review.


Optional improvements

Link

[suggestion] · CheckUnparsable discards the private-input diagnostic

The existing negative cases assert only the second input's diagnostic, so fixture-specific regressions that echo private-input key text can pass those assertions.

Location: src/test/descriptor_tests.cpp:617 (head).

Details and suggested fix

CheckUnparsable parses prv and then pub into the same error variable. Here the malformed WIF produces wpkh(): key is not valid, but the helper checks only the public input's wpkh(): Pubkey is invalid. The new descriptor_errors_do_not_echo_keys test covers representative private inputs, but it does not check every existing private fixture. Save the first diagnostic separately and add an optional expected-private-error argument to cover those fixtures. Do not require it to equal expected_error: private and public diagnostics can legitimately differ, including their computed checksums, and some calls intentionally use an empty prv while placing private material in pub.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.