Skip to content

Conversation

@jtimon
Copy link
Contributor

@jtimon jtimon commented Apr 25, 2015

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Fair enought.

@jonasschnelli
Copy link
Contributor

Tested ACK.
nit: see above.

@jtimon jtimon force-pushed the consensus_finaltx branch from dd06e9e to ee96bbc Compare May 16, 2015 19:27
@jtimon
Copy link
Contributor Author

jtimon commented May 16, 2015

Properly rebased (I missed one recent change in IsFinalTx, the tx.nLockTime == 0 check).

@paveljanik
Copy link
Contributor

utACK

You do not like BOOST_FOREACH? ;-)

@jtimon jtimon force-pushed the consensus_finaltx branch from ee96bbc to fc176a1 Compare May 27, 2015 13:37
@jtimon
Copy link
Contributor Author

jtimon commented May 27, 2015

Updated without touching the foreach loop as discussed on IRC.
Now it's really really trivial...

@laanwj
Copy link
Member

laanwj commented May 27, 2015

utACK, this is contained in #6183

@jtimon
Copy link
Contributor Author

jtimon commented May 27, 2015

Well, not exactly, the names are changed in #6183 and the consensus-unfriendly one doesn't take any parameters besides the transaction.

@jtimon
Copy link
Contributor Author

jtimon commented Jun 2, 2015

Closing after #6183 has been merged.
Btw, @petertodd I think my last suggestion there (not using the activechain global from the new function CheckFinalTx) was a very reasonable nit, I'm a little bit dissapointed that you ignored it.

@jtimon jtimon closed this Jun 2, 2015
@laanwj
Copy link
Member

laanwj commented Jun 2, 2015

@jtimon Feel free to fix that nit anyway - but we just had to move ahead to get the bug fix in.

@petertodd
Copy link
Contributor

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:

@jtimon Feel free to fix that nit anyway - but we just had to move
ahead to get the bug fix in.


Reply to this email directly or view it on GitHub:
#6063 (comment)

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
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