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-03 04:28:48 +0800 |
commit | 0b4fe8d1929ad64ed576f7560dde4179d71ecfcb (patch) | |
tree | 923d7b795c59ddb0e5d338f2b2e6536e00a58c88 /miner | |
parent | e14f8a408c17fd6c57d769cd4635ad6cc8bde769 (diff) | |
download | go-tangerine-0b4fe8d1929ad64ed576f7560dde4179d71ecfcb.tar go-tangerine-0b4fe8d1929ad64ed576f7560dde4179d71ecfcb.tar.gz go-tangerine-0b4fe8d1929ad64ed576f7560dde4179d71ecfcb.tar.bz2 go-tangerine-0b4fe8d1929ad64ed576f7560dde4179d71ecfcb.tar.lz go-tangerine-0b4fe8d1929ad64ed576f7560dde4179d71ecfcb.tar.xz go-tangerine-0b4fe8d1929ad64ed576f7560dde4179d71ecfcb.tar.zst go-tangerine-0b4fe8d1929ad64ed576f7560dde4179d71ecfcb.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 80c1771b6..a9e440aec 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -828,8 +828,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 { @@ -844,7 +844,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() { |