Consensus: Turn CBlockIndex::GetMedianTimePast into independent function#6009
Closed
jtimon wants to merge 7 commits intobitcoin:masterfrom
Closed
Consensus: Turn CBlockIndex::GetMedianTimePast into independent function#6009jtimon wants to merge 7 commits intobitcoin:masterfrom
jtimon wants to merge 7 commits intobitcoin:masterfrom
Conversation
ed57bbb to
6c54698
Compare
6c54698 to
e370994
Compare
Contributor
Author
|
Needed rebase. |
e370994 to
243841f
Compare
Contributor
Author
|
Needed rebase. |
Member
|
utACK |
Member
|
Needs rebase. |
Contributor
Author
243841f to
704737c
Compare
Contributor
Author
|
Rebased |
src/consensus/blockverify.cpp
Outdated
Contributor
|
Modulo nit, (somewhat tested) ACK. |
704737c to
db2894f
Compare
Contributor
Author
|
@petertodd 's nit fixed. |
Contributor
|
utACK |
Contributor
Author
|
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
Contributor
Author
|
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
Contributor
Author
|
Rebased on top of #6591. Still had merging conflicts so rebased on top of master after that. |
Contributor
|
utACK for c85ded0 after nit is addressed |
Contributor
Author
|
Closing in favor of #6672 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.