aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-04-08 21:16:05 +0800
committerGitHub <noreply@github.com>2019-04-08 21:16:05 +0800
commit4e13a09c5033b4cf073db6aeaaa7d159dcf07f30 (patch)
tree0f64daac335200ce6fd45d6ee9f62dabc0fb1887 /miner/worker.go
parentc942700427557e3ff6de3aaf6b916e2f056c1ec2 (diff)
parent009d2fe2d650b1a92e28f0decbf5f7fa628779e9 (diff)
downloaddexon-4e13a09c5033b4cf073db6aeaaa7d159dcf07f30.tar
dexon-4e13a09c5033b4cf073db6aeaaa7d159dcf07f30.tar.gz
dexon-4e13a09c5033b4cf073db6aeaaa7d159dcf07f30.tar.bz2
dexon-4e13a09c5033b4cf073db6aeaaa7d159dcf07f30.tar.lz
dexon-4e13a09c5033b4cf073db6aeaaa7d159dcf07f30.tar.xz
dexon-4e13a09c5033b4cf073db6aeaaa7d159dcf07f30.tar.zst
dexon-4e13a09c5033b4cf073db6aeaaa7d159dcf07f30.zip
Merge pull request #19370 from karalabe/geth-1.8.24
Backport PR for the v1.8.24 maintenance release
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go6
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() {