refactor: CheckFinalTx pass by reference instead of pointer#22282
refactor: CheckFinalTx pass by reference instead of pointer#22282klementtan wants to merge 1 commit intobitcoin:masterfrom
Conversation
|
Concept ACK Candidates for similar treatment can be found using the |
Thanks for informing me be about this. Added a comment on the issue to reference this PR. However, I think I will keep the scope of this PR to |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
| bool CheckFinalTx(const CBlockIndex& active_chain_tip, const CTransaction& tx, int flags) | ||
| { | ||
| AssertLockHeld(cs_main); | ||
| assert(active_chain_tip); // TODO: Make active_chain_tip a reference |
There was a problem hiding this comment.
This removes an assertion and turns a (theoretical) crash into UB
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
|
Closing this PR as this refactor will remove an assertion. |
|
As long as you preserve the assertion, it should be ok. |
Rationale This PR fixes TODO from #21055
bitcoin/src/validation.cpp
Line 183 in 965e937
#20750 (comment) for additional information.
Changes to
CheckFinalTx:active_chain_tipto be passed by reference instead of pointer and shift&oftxto be left-attaching