-
Notifications
You must be signed in to change notification settings - Fork 38.7k
DEPENDENT: Globals: Avoid calling Params() #5970
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
0b4d429 to
9a2b7d3
Compare
|
Note that AcceptToMemoryPool is ignored because the calls to Params() there will be replaced with policy initialization in init.cpp. |
018f16e to
69dcb20
Compare
bce9d09 to
426b8a8
Compare
0fa8e89 to
80b1eb5
Compare
e0e2102 to
b8e6dc3
Compare
|
Closing for now, although I will keep updating the dependencies and rebasing. |
b8e6dc3 to
66b91b2
Compare
|
Comparison URL to review this PR independently of its dependent: jtimon/bitcoin@consensus-params-0.12.99...jtimon:chainparams_cleanup |
a1f7b3a to
a8fe228
Compare
a8fe228 to
0e1d15b
Compare
|
Rebased on top of #6591 |
0e1d15b to
9298359
Compare
2b3dd9a to
0664e23
Compare
0664e23 to
2bcce4e
Compare
2bcce4e to
3de575a
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. 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
3de575a to
e3e49f6
Compare
-AcceptBlock -AcceptBlockHeader -ActivateBestChain -ConnectTip -InitBlockIndex -LoadExternalBlockFile -VerifyDB parametric constructor
…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.
e3e49f6 to
11bcb7b
Compare
|
Replaced by #7053. Since I think it was extremely In addition, this was never complete but as new functions are created I will post here to link to that new DEPENDENT PR. In the meantime, |
Passing CChainParams explicitly as parameter when possible facilitates testing and refactoring.
Dependencies:
[ ] Chainparams: Explicit Consensus::Params arg in consensus functions Chainparams: Explicit Consensus::Params arg in consensus functions #6024EDIT Initial description:
After the struct Consensus::Params was created in #5812, there are some redundant getters in CChainParams. This depends on all the PRs that help remove them and continues passing CChainParams and Consensus::Params more explicitly, mainly in main.o, miner.o and init.cpp.
The rpc's, net.o, rest.o and base58.o are left with direct Params() calls. In the tests, Params(CBaseChainParams::MAIN) is preferred.