Consensus: Adapt declarations of most obviously consensus functions #6591
Closed
jtimon wants to merge 6 commits intobitcoin:masterfrom
Closed
Consensus: Adapt declarations of most obviously consensus functions #6591jtimon wants to merge 6 commits intobitcoin:masterfrom
jtimon wants to merge 6 commits intobitcoin:masterfrom
Conversation
Contributor
|
concept ACK |
This was referenced Aug 27, 2015
Contributor
|
Concept ACK. |
Contributor
Author
|
@jonasschnelli |
676aac3 to
114b504
Compare
Contributor
Author
|
Rebased on top of modified #6625 and force-pushed. |
…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.
114b504 to
be466dc
Compare
This was referenced Sep 13, 2015
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.
Before the first step #5696 (after creating an initial libconsensus and without counting checkpoints and Consensus::Params changes) gets negated (see #6526), here's a little second step towards completing libconsensus. This is also part of #5970 process of explicitly passing chainparams around, and in that sense it replaces #6024.
The function declarations are adapted and moved to consensus/consensus.h
Since we're touching all declarations, it is diff-wise free to put them in the Consensus namespace at the same time. It also cherry picks one commit from #6526 (modified to rename CheckTransaction to Consensus::CheckTx [again, that rename is diff-wise free]).
The function definitions are left in main.cpp for now, but some of them will have to be moved to consensus/consensus.cpp before exposing anything else in libconsensus (my preference would be to expose VerifyHeader next, but I haven't got much feedback in that reward).
Blocked by: