Consensus: Turn CBlockIndex::GetMedianTimePast into independent function #6009
pull jtimon wants to merge 7 commits into bitcoin:master from jtimon:consensus_mediantime changing 26 files +244 −126-
jtimon commented at 5:31 pm on April 13, 2015: contributorContextualCheckBlockHeader() [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.
-
jtimon force-pushed on Apr 13, 2015
-
jtimon force-pushed on Apr 20, 2015
-
jtimon commented at 7:49 pm on April 20, 2015: contributorNeeded rebase.
-
laanwj added the label Consensus on Apr 29, 2015
-
jtimon force-pushed on Apr 29, 2015
-
jtimon commented at 2:15 pm on April 29, 2015: contributorNeeded rebase.
-
sipa commented at 6:48 am on April 30, 2015: memberutACK
-
sipa commented at 2:57 pm on June 16, 2015: memberNeeds rebase.
-
jtimon force-pushed on Jun 21, 2015
-
jtimon commented at 1:02 pm on June 21, 2015: contributorRebased
-
in src/consensus/blockverify.cpp: in 704737c721 outdated
5+ 6+#include "consensus/consensus.h" 7+ 8+#include "chain.h" 9+ 10+#include <algorithm>
petertodd commented at 5:07 am on June 22, 2015:Nit: tailing whitespacepetertodd commented at 5:20 am on June 22, 2015: contributorModulo nit, (somewhat tested) ACK.jtimon force-pushed on Jun 25, 2015jtimon commented at 5:13 pm on June 25, 2015: contributor@petertodd ’s nit fixed.btcdrak commented at 2:03 pm on June 26, 2015: contributorutACKjtimon closed this on Jul 15, 2015
jtimon reopened this on Aug 26, 2015
jtimon force-pushed on Aug 26, 2015jtimon commented at 8:24 am on August 26, 2015: contributorRebased and reopened.jtimon force-pushed on Sep 13, 2015consensus: don't define MAX_STANDARD_TX_SIGOPS in terms of block size 46f073ba77consensus: teach ExtractMatches to check for an arbitrary max transaction 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.
consensus: teach CheckTransaction to check for an arbitrary max tx size
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.
consensus: Move consensus constants into Consensus::Params and consensus.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
Consensus: MOVEONLY: Most important consensus function declarations to consensus/consensus.h 664549eb00Consensus: Chainparams: Explicit Consensus::Params for consensus functions:
-CheckBlockHeader -ContextualCheckBlockHeader -CheckBlock -ContextualCheckBlock Also add nTime parameter to CheckBlockHeader and CheckBlock. Also use the oportunity to rename the functions inside the Consensus namespace.
Consensus: Refactor: Turn CBlockIndex::GetMedianTimePast into independent function
...and CBlockIndex::nMedianTimeSpan into Consensus::Params::nMedianTimeSpan
jtimon force-pushed on Sep 13, 2015dcousens commented at 3:17 am on September 14, 2015: contributorutACK for c85ded0 after nit is addressedjtimon closed this on Sep 14, 2015
DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 18:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 18:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me