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.
643 | @@ -644,6 +644,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) 644 | return true; 645 | } 646 | 647 | +bool CheckFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime);
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.
This declaration will be necessary later anyway when the function is moved in https://github.com/jtimon/bitcoin/commit/6769c02ca34303648de74f42c7dfd0cb1aaa41da#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.
Okay. Fair enought.
Tested ACK. nit: see above.
Properly rebased (I missed one recent change in IsFinalTx, the tx.nLockTime == 0 check).
utACK
You do not like BOOST_FOREACH? ;-)
Updated without touching the foreach loop as discussed on IRC. Now it's really really trivial...
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.
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" notifications@github.com 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)