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.
This commit is contained in:
Mark Friedenbach 2015-06-03 15:01:47 -07:00 committed by Matt Corallo
parent 8bdb2d4d1d
commit bbdccaa987
3 changed files with 15 additions and 14 deletions

View file

@ -795,7 +795,8 @@ int64_t CheckLockTime(const CTransaction &tx, int flags)
// current network-enforced consensus rules should be used. In
// a future soft-fork scenario that would mean an
// IsSuperMajority check against chainActive.Tip().
flags = std::max(flags, 0);
if (flags < 0)
flags = LOCKTIME_MEDIAN_TIME_PAST;
// pcoinsTip contains the UTXO set for chainActive.Tip()
const CCoinsView *pCoinsView = pcoinsTip;
@ -1091,7 +1092,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
// Enforce sequnce numbers as relative lock-time
// only for tx.nVersion >= 2.
int nLockTimeFlags = 0;
int nLockTimeFlags = LOCKTIME_MEDIAN_TIME_PAST;
if (tx.nVersion >= 2)
nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE;