Skip to content

Commit 733fa0b

Browse files
committed
miner: never create a template which exploits the timewarp bug
1 parent f7144b2 commit 733fa0b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/node/miner.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParam
3333
int64_t nOldTime = pblock->nTime;
3434
int64_t nNewTime{std::max<int64_t>(pindexPrev->GetMedianTimePast() + 1, TicksSinceEpoch<std::chrono::seconds>(NodeClock::now()))};
3535

36-
if (consensusParams.enforce_BIP94) {
37-
// Height of block to be mined.
38-
const int height{pindexPrev->nHeight + 1};
39-
if (height % consensusParams.DifficultyAdjustmentInterval() == 0) {
40-
nNewTime = std::max<int64_t>(nNewTime, pindexPrev->GetBlockTime() - MAX_TIMEWARP);
41-
}
36+
// Height of block to be mined.
37+
const int height{pindexPrev->nHeight + 1};
38+
if (height % consensusParams.DifficultyAdjustmentInterval() == 0) {
39+
nNewTime = std::max<int64_t>(nNewTime, pindexPrev->GetBlockTime() - MAX_TIMEWARP);
4240
}
4341

4442
if (nOldTime < nNewTime) {

0 commit comments

Comments
 (0)