diff options
author | Martin Holst Swende <martin@swende.se> | 2019-04-03 04:28:48 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-04-08 17:00:42 +0800 |
commit | af401d03a395c21fdb297edb687edf8af3470cb2 (patch) | |
tree | d2ee3476c9005ffe1aca7abbe7152765da0efe32 /miner | |
parent | 80a2a35bc3aaf208b5f91a1fb1d803975d4bb01c (diff) | |
download | go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.gz go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.bz2 go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.lz go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.xz go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.zst go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.zip |
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
Diffstat (limited to 'miner')
-rw-r--r-- | miner/worker.go | 6 |
1 files changed, 3 insertions, 3 deletions
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() { |