-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Consensus: Turn CBlockIndex::GetMedianTimePast into independent function #6009
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
ed57bbb
to
6c54698
Compare
6c54698
to
e370994
Compare
Needed rebase. |
e370994
to
243841f
Compare
Needed rebase. |
utACK |
Needs rebase. |
243841f
to
704737c
Compare
Rebased |
|
||
#include "chain.h" | ||
|
||
#include <algorithm> |
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: tailing whitespace
Modulo nit, (somewhat tested) ACK. |
704737c
to
db2894f
Compare
@petertodd 's nit fixed. |
utACK |
Closing for now EDIT: as said on #6051 I'm not convinced anymore that is a good idea to create consensus/txverify.cpp and consensus/blockverify.cpp instead of just consensus/consensus.cpp. |
db2894f
to
da6dfe3
Compare
Rebased and reopened. |
da6dfe3
to
718f6f2
Compare
…tion number This is a no-op change. For now, everything passes MAX_BLOCK_SIZE / 60, so the result matches what it would've before. Tests use a number equal to the number of transactions where necessary, to ensure that they're never rejected when blocksizesize isn't being tested.
This is a no-op change. For now, everything passes MAX_BLOCK_SIZE, so the result matches what it would've before. Tests use a value of std::numeric_limits<uint64_t>::max() where necessary, to ensure that they're never rejected when size isn't being tested.
…sus.h (as functions) The following are now tied to a chain rather than being defined as global constants. Their values have not changed. nMinTxSize nMaxBlockSize nMaxTxSize nMaxBlockSigops nCoinbaseMaturity Also, for free (diff-wise): Blocksize: Turn MAX_BLOCK_SIZE (nMaxBlockSize) and MAX_BLOCK_SIGOPS (nMaxBlockSigops) into functions ...which take Consensus::Params as parameter This will be convenient to reduce the diff of any proposal that changes the blocksize as a hardfork
…o consensus/consensus.h
…tions: -CheckBlockHeader -ContextualCheckBlockHeader -CheckBlock -ContextualCheckBlock Also add nTime parameter to CheckBlockHeader and CheckBlock. Also use the oportunity to rename the functions inside the Consensus namespace.
…dent function ...and CBlockIndex::nMedianTimeSpan into Consensus::Params::nMedianTimeSpan
718f6f2
to
c85ded0
Compare
Rebased on top of #6591. Still had merging conflicts so rebased on top of master after that. |
utACK for c85ded0 after nit is addressed |
Closing in favor of #6672 . |
ContextualCheckBlockHeader() [which is needed to verify a block header] depends on CBlockIndex::GetMedianTimePast but the goal is for verify block header is to be independent from chain.o and CBlockIndex C++ class [which cannot be exposed in the consensus C API].
This is also contained in #5995.