Skip to content

Commit fc3941d

Browse files
CJentzschobscuren
authored andcommitted
fix block time issue
currently, under normal circumstances, you always set the timestamp to previous.Time() + 1. credits to https://www.reddit.com/r/ethereum/comments/3jcs5r/code_avg_block_time_vs_difficulty_adjustment/cuoi4op style
1 parent 8f09242 commit fc3941d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

miner/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ func (self *worker) commitNewWork() {
434434
tstart := time.Now()
435435
parent := self.chain.CurrentBlock()
436436
tstamp := tstart.Unix()
437-
if parent.Time().Cmp(new(big.Int).SetInt64(tstamp)) != 1 {
437+
if parent.Time().Cmp(new(big.Int).SetInt64(tstamp)) >= 0 {
438438
tstamp = parent.Time().Int64() + 1
439439
}
440440
// this will ensure we're not going off too far in the future

0 commit comments

Comments
 (0)