.
. #33833
pull 777genius wants to merge 1 commits into bitcoin:master from 777genius:refactor/verifyscript-remove-null-check changing 22 files +59 −60-
777genius commented at 5:36 PM on November 9, 2025: none
- DrahtBot added the label Consensus on Nov 9, 2025
-
DrahtBot commented at 5:36 PM on November 9, 2025: 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/33833.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process. A summary of reviews will appear here.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
-
490c39d842
script: Remove dead nullptr check in VerifyScript
Change VerifyScript witness parameter from pointer to reference, removing the nullptr check and static emptyWitness that were never used in practice. Analysis of all call sites shows that: - Production code always passes &obj (address of existing witness) - Test code that needs empty witness now uses EMPTY_SCRIPT_WITNESS constant The nullptr check was dead code, as evidenced by: 1. All 48 call sites across the codebase pass either &witness or EMPTY_SCRIPT_WITNESS 2. No caller ever passes nullptr to the witness parameter 3. The static emptyWitness inside VerifyScript was unreachable Changes: - Modified VerifyScript signature: CScriptWitness* → CScriptWitness& - Removed static emptyWitness and nullptr check (4 lines) - Updated all pointer dereferences (*witness → witness, witness-> → witness.) - Added EMPTY_SCRIPT_WITNESS constant to script.h for test code - Updated 48 call sites across 22 files This follows the same pattern as #33786, which removed similar dead code from CountWitnessSigOps. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- achow101 closed this on Nov 9, 2025
- bitcoin locked this on Nov 9, 2025
- achow101 renamed this:
script: Remove dead nullptr check in VerifyScript
.
on Nov 9, 2025 - fanquake removed the label Consensus on Nov 10, 2025