-
Notifications
You must be signed in to change notification settings - Fork 37.7k
miner: Remove uncompiled MTP code #23637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK. Might have been nicer to review as 2 commits (splitting the formatting/rename changes out of the code removal)
Can be reviewed with --word-diff-regex=. --ignore-all-space
fa5a3f8
to
fa46ac4
Compare
Thanks. Reworked into two commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK fa46ac4
Complied and ran bitcoind successfully with the following patch:
static_assert(STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST)
This goes to show that the above statement is always true. Hence I agree with removing the conditional part of the code that shall never be reached. The renaming of the variable makes sense and follows our global variable naming convention.
Finally, the formatting changes introduced in the first commit of this PR look good. I checked for possible formatting issues, and I found none.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-review ACK fa46ac4
337edd2 miner: Remove uncompiled MTP code (MarcoFalke) ae1993b style: Add {} to if-bodies in node/miner (MarcoFalke) Pull request description: This removes uncompiled code. Can be checked by inserting `static_assert(STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST)` and compiling or by reading the source code. Even if the code was compiled, it would be unsafe to execute, since it is not allowed to include transactions that are locked until some time after the current MTP. Also, rename the member to cause explicit merge conflicts in case there is a patch out there referencing the variable. ACKs for top commit: shaavan: ACK 337edd2 theStack: Code-review ACK 337edd2 Tree-SHA512: 0288f45918996b58d0c0060773aa3cb15c828a649439f3d589c5d6b4854d6da1d8c2ea11d5ca06c654532453ab5ce1892de7ca820e284e96e78b959ef87cac5c
This removes uncompiled code.
Can be checked by inserting
static_assert(STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST)
and compiling or by reading the source code.Even if the code was compiled, it would be unsafe to execute, since it is not allowed to include transactions that are locked until some time after the current MTP.
Also, rename the member to cause explicit merge conflicts in case there is a patch out there referencing the variable.