Commit graph

14 commits

Author SHA1 Message Date
Gregory Maxwell e4e5334ef8 Restore MedianTimePast for locktime.
Revert "Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations""
This reverts commit 40cd32e835.

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-03 17:12:36 +00:00
Gregory Maxwell 40cd32e835 Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations"
This reverts commit 9d55050773.

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-11-01 20:05:18 +00:00
Mark Friedenbach 9d55050773 Add rules--presently disabled--for using GetMedianTimePast as endpoint for 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-23 09:02:24 -07:00
Eric Lombrozo 7801f4387d Added fPowNoRetargeting field to Consensus::Params that disables nBits recalculation. 2015-10-19 14:25:21 -04:00
Wladimir J. van der Laan fbf44e6f3e Add debug message to CValidationState for optional extra information
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-08-06 09:47:01 +02:00
Shaul Kfir a651403e09 Add absurdly high fee message to validation state (for RPC propagation) 2015-06-30 15:59:11 -04:00
Wladimir J. van der Laan 41076aad0c
Merge pull request #6124
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-26 14:42:45 +02:00
Philip Kaufmann a9ac95c1bc use const references where appropriate 2015-06-04 19:34:18 +02:00
jtimon da29ecbcc6 Consensus: MOVEONLY: Move CValidationState from main consensus/validation 2015-05-15 16:05:28 +02:00
Peter Todd 48e9c57cf0 Move LOCKTIME_THRESHOLD to src/script/script.h
Will now be needed by CHECKLOCKTIMEVERIFY code.
2015-05-09 04:33:49 -04:00
jtimon 691161d419 Consensus: Create consensus/consensus.h with some constants 2015-04-20 21:27:51 +02:00
Philip Kaufmann a21df62069 ensure consistent header comment naming conventions
- BITCOIN_FOLDER_SUBFOLDER_FILENAME_H
2015-04-20 13:29:22 +02:00
Cory Fields fd311996e8 consensus: don't use arith_uint256 in consensus.h
Requiring arith_uint256 at such a base level is not good for modularity.
2015-04-10 15:33:37 -04:00
Jorge Timón bd006110fb Consensus: Refactor: Introduce Consensus::Params class 2015-03-25 20:39:26 +01:00