diff options
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/miner.cpp | 8 | ||||
-rw-r--r-- | src/node/miner.h | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/node/miner.cpp b/src/node/miner.cpp index 046cc618ce..291a6e1d10 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -134,11 +134,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc } pblock->nTime = GetAdjustedTime(); - const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); - - nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST) - ? nMedianTimePast - : pblock->GetBlockTime(); + m_lock_time_cutoff = pindexPrev->GetMedianTimePast(); // Decide whether to include witness transactions // This is only needed in case the witness softfork activation is reverted @@ -223,7 +219,7 @@ bool BlockAssembler::TestPackage(uint64_t packageSize, int64_t packageSigOpsCost bool BlockAssembler::TestPackageTransactions(const CTxMemPool::setEntries& package) const { for (CTxMemPool::txiter it : package) { - if (!IsFinalTx(it->GetTx(), nHeight, nLockTimeCutoff)) { + if (!IsFinalTx(it->GetTx(), nHeight, m_lock_time_cutoff)) { return false; } if (!fIncludeWitness && it->GetTx().HasWitness()) { diff --git a/src/node/miner.h b/src/node/miner.h index be5e2bbe91..e50db731b7 100644 --- a/src/node/miner.h +++ b/src/node/miner.h @@ -144,7 +144,8 @@ private: // Chain context for the block int nHeight; - int64_t nLockTimeCutoff; + int64_t m_lock_time_cutoff; + const CChainParams& chainparams; const CTxMemPool& m_mempool; CChainState& m_chainstate; |