From af401d03a395c21fdb297edb687edf8af3470cb2 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 2 Apr 2019 22:28:48 +0200 Subject: all: simplify timestamps to uint64 (#19372) * all: simplify timestamps to uint64 * tests: update definitions * clef, faucet, mobile: leftover uint64 fixups * ethash: fix tests * graphql: update schema for timestamp * ethash: remove unused variable --- 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 48473796b..44a9f44f7 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -823,8 +823,8 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64) tstart := time.Now() parent := w.chain.CurrentBlock() - if parent.Time().Cmp(new(big.Int).SetInt64(timestamp)) >= 0 { - timestamp = parent.Time().Int64() + 1 + if parent.Time() >= uint64(timestamp) { + timestamp = int64(parent.Time() + 1) } // this will ensure we're not going off too far in the future if now := time.Now().Unix(); timestamp > now+1 { @@ -839,7 +839,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64) Number: num.Add(num, common.Big1), GasLimit: core.CalcGasLimit(parent, w.gasFloor, w.gasCeil), Extra: w.extra, - Time: big.NewInt(timestamp), + Time: uint64(timestamp), } // Only set the coinbase if our consensus engine is running (avoid spurious block rewards) if w.isRunning() { -- cgit v1.2.3