Skip to content

Commit 4a726e6

Browse files
committedAug 21, 2019
CHANGED: miner to push block time to the limit
1 parent 32795aa commit 4a726e6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/miner.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParam
7474
nNewTime = std::max(nNewTime, nPrevTime+1);
7575
}
7676

77-
// Try aggressively, but ensure steady progress
78-
nNewTime = std::max(nNewTime, GetAdjustedTime() - 60);
77+
// Try aggressively, but ensure steady progress (just in case, should never be triggered)
78+
nNewTime = std::max(nNewTime, GetAdjustedTime() - consensusParams.nPowTargetSpacing);
79+
80+
// If a block goes into the future, try to push children there.
81+
nNewTime = std::max(nNewTime, pindexPrev->GetBlockTimeMax() - consensusParams.nPowTargetSpacing);
7982

8083
if (nOldTime < nNewTime)
8184
pblock->nTime = nNewTime;

0 commit comments

Comments
 (0)
Please sign in to comment.