diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-10-26 11:32:43 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-10-26 11:32:46 +0100 |
| commit | ff057f41aa14fcedc40dd14d70242cf6b88601dc (patch) | |
| tree | 825ab51f6d1a3a4246a444a2d05ab815cd6e0d15 /src/miner.cpp | |
| parent | Merge pull request #6877 (diff) | |
| parent | Enable policy enforcing GetMedianTimePast as the end point of lock-time const... (diff) | |
| download | discoin-ff057f41aa14fcedc40dd14d70242cf6b88601dc.tar.xz discoin-ff057f41aa14fcedc40dd14d70242cf6b88601dc.zip | |
Merge pull request #6566
dea8d21 Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints (Mark Friedenbach)
9d55050 Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations (Mark Friedenbach)
Diffstat (limited to 'src/miner.cpp')
| -rw-r--r-- | src/miner.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/miner.cpp b/src/miner.cpp index 42c8bb970..053d9cdbc 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -148,6 +148,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) CBlockIndex* pindexPrev = chainActive.Tip(); const int nHeight = pindexPrev->nHeight + 1; pblock->nTime = GetAdjustedTime(); + const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); CCoinsViewCache view(pcoinsTip); // Priority order to process transactions @@ -162,7 +163,12 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) mi != mempool.mapTx.end(); ++mi) { const CTransaction& tx = mi->GetTx(); - if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, pblock->nTime)) + + int64_t nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST) + ? nMedianTimePast + : pblock->GetBlockTime(); + + if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, nLockTimeCutoff)) continue; COrphan* porphan = NULL; |