-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Consensus: Refactor: Separate CheckFinalTx from main::IsFinalTx #6063
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.
nit: To avoid this declaration, would it not be possible to move the implementation of CheckFinalTx() (L661) above isFinalTx() (above L648)? IIRC we don't have function declarations in main.cpp.
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.
This declaration will be necessary later anyway when the function is moved in jtimon@6769c02#diff-cbe22f30d7e480617350ef6ceca97d0cR65
So it's a temporary thing, and, yes, we have function declarations in main.cpp, for example, these two: https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L81
The reason to make it in this way is to make the diff smaller.
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.
Okay. Fair enought.
|
Tested ACK. |
|
Properly rebased (I missed one recent change in IsFinalTx, the |
|
utACK You do not like BOOST_FOREACH? ;-) |
|
Updated without touching the foreach loop as discussed on IRC. |
|
utACK, this is contained in #6183 |
|
Well, not exactly, the names are changed in #6183 and the consensus-unfriendly one doesn't take any parameters besides the transaction. |
|
Closing after #6183 has been merged. |
|
@jtimon Feel free to fix that nit anyway - but we just had to move ahead to get the bug fix in. |
|
Yup, that's my thoughts here too. However give me a week or so and I'll do up that median time patch design so we can fix this exactly once. On "vacation" right now. :) On 2 June 2015 13:57:04 CEST, "Wladimir J. van der Laan" [email protected] wrote:
|
A simple refactor as preparation for moving consensus to code for transaction validation.
The consensus version of IsFinalTx() cannot use chainActive.Height() or GetAdjustedTime()
This is part of #6051 but can be merged independently.