From 4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Tue, 30 Jun 2015 09:13:16 +0200 Subject: Use uint64 for block header timestamp --- miner/worker.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'miner') diff --git a/miner/worker.go b/miner/worker.go index f06b6afa1..90914ddcb 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -368,8 +368,8 @@ func (self *worker) commitNewWork() { tstart := time.Now() parent := self.chain.CurrentBlock() tstamp := tstart.Unix() - if tstamp <= parent.Time() { - tstamp = parent.Time() + 1 + if tstamp <= int64(parent.Time()) { + tstamp = int64(parent.Time()) + 1 } // this will ensure we're not going off too far in the future if now := time.Now().Unix(); tstamp > now+4 { @@ -382,7 +382,7 @@ func (self *worker) commitNewWork() { header := &types.Header{ ParentHash: parent.Hash(), Number: num.Add(num, common.Big1), - Difficulty: core.CalcDifficulty(tstamp, parent.Time(), parent.Difficulty()), + Difficulty: core.CalcDifficulty(int64(tstamp), int64(parent.Time()), parent.Difficulty()), GasLimit: core.CalcGasLimit(parent), GasUsed: new(big.Int), Coinbase: self.coinbase, -- cgit