Backport of #6566
Backport #6566, median-past locktime, rebased against 0.11 #6884
pull btcdrak wants to merge 2 commits into bitcoin:0.11 from btcdrak:mpl-0.11 changing 5 files +58 −12-
btcdrak commented at 8:20 PM on October 23, 2015: contributor
-
a1d3c6fb9d
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.
-
f720c5fc9f
Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints
Transactions are not allowed in the memory pool or selected for inclusion in a block until their lock times exceed chainActive.Tip()->GetMedianTimePast(). However blocks including transactions which are only mature under the old rules are still accepted; this is *not* the soft-fork required to actually rely on the new constraint in production.
- btcdrak force-pushed on Oct 23, 2015
- laanwj added the label Mempool on Oct 26, 2015
-
gmaxwell commented at 12:44 AM on November 4, 2015: contributor
ACK.
- laanwj merged this on Nov 5, 2015
- laanwj closed this on Nov 5, 2015
- laanwj referenced this in commit df616ae43e on Nov 5, 2015
- btcdrak deleted the branch on Nov 5, 2015
- harding referenced this in commit 929b2c73df on Nov 8, 2015
- fanquake locked this on Jan 9, 2021