mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
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:
parent
8bdb2d4d1d
commit
bbdccaa987
3 changed files with 15 additions and 14 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue