aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-06-30 15:13:16 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-06-30 16:52:11 +0800
commit4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d (patch)
tree4bb5055690cae276a5480572b463cd06fa219f23 /miner
parentbe935bff84d54cd7a7f4074e2326d62f664ba4e3 (diff)
downloaddexon-4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d.tar
dexon-4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d.tar.gz
dexon-4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d.tar.bz2
dexon-4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d.tar.lz
dexon-4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d.tar.xz
dexon-4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d.tar.zst
dexon-4c490db6afeb5a48d3e8d1d65ea8ddc9811d0a6d.zip
Use uint64 for block header timestamp
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 f06b6afa1..90914ddcb 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -368,8 +368,8 @@ func (self *worker) commitNewWork() {
tstart := time.Now()
parent := self.chain.CurrentBlock()
tstamp := tstart.Unix()
- if tstamp <= parent.Time() {
- tstamp = parent.Time() + 1
+ if tstamp <= int64(parent.Time()) {
+ tstamp = int64(parent.Time()) + 1
}
// this will ensure we're not going off too far in the future
if now := time.Now().Unix(); tstamp > now+4 {
@@ -382,7 +382,7 @@ func (self *worker) commitNewWork() {
header := &types.Header{
ParentHash: parent.Hash(),
Number: num.Add(num, common.Big1),
- Difficulty: core.CalcDifficulty(tstamp, parent.Time(), parent.Difficulty()),
+ Difficulty: core.CalcDifficulty(int64(tstamp), int64(parent.Time()), parent.Difficulty()),
GasLimit: core.CalcGasLimit(parent),
GasUsed: new(big.Int),
Coinbase: self.coinbase,