Rationale This PR fixes TODO from #21055
#20750 (review) for additional information.
Changes to CheckFinalTx: active_chain_tip to be passed by reference instead of pointer and shift & of tx to be left-attaching
Rationale This PR fixes TODO from #21055
#20750 (review) for additional information.
Changes to CheckFinalTx: active_chain_tip to be passed by reference instead of pointer and shift & of tx to be left-attaching
Code-review ACK 10caa3e4b167dae26d52838ad19f8c137c9c0a14 🥥
ack 10caa3e4b167dae26d52838ad19f8c137c9c0a14
Concept ACK
Candidates for similar treatment can be found using the git grep commands in #19062 :)
Candidates for similar treatment can be found using the
git grepcommands in #19062 :)
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 CheckFianlTx to make it easy to review.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, 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.
176 | @@ -177,10 +177,9 @@ bool CheckInputScripts(const CTransaction& tx, TxValidationState& state, 177 | std::vector<CScriptCheck>* pvChecks = nullptr) 178 | EXCLUSIVE_LOCKS_REQUIRED(cs_main); 179 | 180 | -bool CheckFinalTx(const CBlockIndex* active_chain_tip, const CTransaction &tx, int flags) 181 | +bool CheckFinalTx(const CBlockIndex& active_chain_tip, const CTransaction& tx, int flags) 182 | { 183 | AssertLockHeld(cs_main); 184 | - assert(active_chain_tip); // TODO: Make active_chain_tip a reference
This removes an assertion and turns a (theoretical) crash into UB
<!--cf906140f33d8803c4a75a2196329ecb-->
🐙 This pull request conflicts with the target branch and needs rebase.
<sub>Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".</sub>
Closing this PR as this refactor will remove an assertion.
As long as you preserve the assertion, it should be ok.