aboutsummaryrefslogtreecommitdiff
path: root/src/consensus
AgeCommit message (Collapse)Author
2015-11-27Switch blocks to a constant-space Merkle root/branch algorithm.Pieter Wuille
This switches the Merkle tree logic for blocks to one that runs in constant (small) space. The old code is moved to tests, and a new test is added that for various combinations of block sizes, transaction positions to compute a branch for, and mutations: * Verifies that the old code and new code agree for the Merkle root. * Verifies that the old code and new code agree for the Merkle branch. * Verifies that the computed Merkle branch is valid. * Verifies that mutations don't change the Merkle root. * Verifies that mutations are correctly detected.
2015-11-27Add merkle.{h,cpp}, generic merkle root/branch algorithmPieter Wuille
2015-11-12Merge pull request #6931Pieter Wuille
33c90cf Make skipping BIP30 check chain agnostic (Alex Morcos) 06d81ad Skip BIP30 check after BIP34 activation (Alex Morcos)
2015-11-03Restore MedianTimePast for locktime.Gregory Maxwell
Revert "Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations"" This reverts commit 40cd32e835092c3158175511da5193193ec54939. After careful analysis it was determined that the change was, in fact, safe and several people were suffering momentary confusion about locktime semantics.
2015-11-02Make skipping BIP30 check chain agnosticAlex Morcos
2015-11-01Revert "Add rules--presently disabled--for using GetMedianTimePast as ↵Gregory Maxwell
endpoint for lock-time calculations" This reverts commit 9d55050773d57c0e12005e524f2e54d9e622c6e2. As noted by Luke-Jr, under some conditions this will accept transactions which are invalid by the network rules. This happens when the current block time is head of the median time past and a transaction's locktime is in the middle. This could be addressed by changing the rule to MAX(this_block_time, MTP+offset) but this solution and the particular offset used deserve some consideration.
2015-10-23Add rules--presently disabled--for using GetMedianTimePast as endpoint for ↵Mark Friedenbach
lock-time calculations The lock-time code currently uses CBlock::nTime as the cutoff point for time based locked transactions. This has the unfortunate outcome of creating a perverse incentive for miners to lie about the time of a block in order to collect more fees by including transactions that by wall clock determination have not yet matured. By using CBlockIndex::GetMedianTimePast from the prior block instead, the self-interested miner no longer gains from generating blocks with fraudulent timestamps. Users can compensate for this change by simply adding an hour (3600 seconds) to their time-based lock times. If enforced, this would be a soft-fork change. This commit only adds the functionality on an unexecuted code path, without changing the behaviour of Bitcoin Core.
2015-10-19Added fPowNoRetargeting field to Consensus::Params that disables nBits ↵Eric Lombrozo
recalculation.
2015-08-06Add debug message to CValidationState for optional extra informationWladimir J. van der Laan
Add a field `strDebugMessage` which can be passed to DoS or Invalid, and queried using GetDebugMessage() to add extra troubleshooting information to the validation state.
2015-06-30Add absurdly high fee message to validation state (for RPC propagation)Shaul Kfir
2015-06-26Merge pull request #6124Wladimir J. van der Laan
ffd75ad Enable CHECKLOCKTIMEVERIFY as a standard script verify flag (Peter Todd) bc60b2b Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) (Peter Todd) 48e9c57 Move LOCKTIME_THRESHOLD to src/script/script.h (Peter Todd) 99088d6 Make CScriptNum() take nMaxNumSize as an argument (Peter Todd)
2015-06-04use const references where appropriatePhilip Kaufmann
2015-05-15Consensus: MOVEONLY: Move CValidationState from main consensus/validationjtimon
2015-05-09Move LOCKTIME_THRESHOLD to src/script/script.hPeter Todd
Will now be needed by CHECKLOCKTIMEVERIFY code.
2015-04-20Consensus: Create consensus/consensus.h with some constantsjtimon
2015-04-20ensure consistent header comment naming conventionsPhilip Kaufmann
- BITCOIN_FOLDER_SUBFOLDER_FILENAME_H
2015-04-10consensus: don't use arith_uint256 in consensus.hCory Fields
Requiring arith_uint256 at such a base level is not good for modularity.
2015-03-25Consensus: Refactor: Introduce Consensus::Params classJorge Timón