aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
Diffstat (limited to 'miner')
-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() {