Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Nov 30, 2021

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.

Copy link
Member

@luke-jr luke-jr left a 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)

MarcoFalke added 2 commits December 1, 2021 09:30
Can be reviewed with --word-diff-regex=. --ignore-all-space
@maflcko
Copy link
Member Author

maflcko commented Dec 1, 2021

Might have been nicer to review as 2 commits

Thanks. Reworked into two commits.

Copy link
Contributor

@shaavan shaavan left a 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.

Copy link
Contributor

@theStack theStack left a 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

@fanquake fanquake merged commit df562d6 into bitcoin:master Dec 2, 2021
@maflcko maflcko deleted the 2111-minerOnlyMTP branch December 2, 2021 07:36
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 2, 2021
RandyMcMillan pushed a commit to RandyMcMillan/mempool-tab that referenced this pull request Dec 23, 2021
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
@bitcoin bitcoin locked and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants