From 20c8f17a8f7e18de2d011ce1bd7303465cd1768c Mon Sep 17 00:00:00 2001 From: Christoph Jentzsch Date: Wed, 2 Sep 2015 23:21:55 +0200 Subject: [PATCH] fix block time issue currently, under normal circumstances, you always set the timestamp to previous.Time() + 1. --- miner/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/worker.go b/miner/worker.go index 86970ec071..aed93e2d2c 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -434,7 +434,7 @@ func (self *worker) commitNewWork() { tstart := time.Now() parent := self.chain.CurrentBlock() tstamp := tstart.Unix() - if parent.Time().Cmp(new(big.Int).SetInt64(tstamp)) != 1 { + if parent.Time().Cmp(new(big.Int).SetInt64(tstamp)) != -1 { tstamp = parent.Time().Int64() + 1 } // this will ensure we're not going off too far in the future