Compare commits

..

2 Commits

Author SHA1 Message Date
587669215b cmd/geth: bump 1.1.2 2015-09-03 00:52:42 +02:00
fc3941d1fd fix block time issue
currently, under normal circumstances, you always set the timestamp to previous.Time() + 1.
credits to https://www.reddit.com/r/ethereum/comments/3jcs5r/code_avg_block_time_vs_difficulty_adjustment/cuoi4op

style
2015-09-03 00:16:59 +02:00
2 changed files with 3 additions and 3 deletions

View File

@ -48,10 +48,10 @@ import (
const (
ClientIdentifier = "Geth"
Version = "1.1.1"
Version = "1.1.2"
VersionMajor = 1
VersionMinor = 1
VersionPatch = 1
VersionPatch = 2
)
var (

View File

@ -434,7 +434,7 @@ func (self *worker) commitNewWork() {
tstart := time.Now()
parent := self.chain.CurrentBlock()
tstamp := tstart.Unix()
if parent.Time().Cmp(new(big.Int).SetInt64(tstamp)) != 1 {
if parent.Time().Cmp(new(big.Int).SetInt64(tstamp)) >= 0 {
tstamp = parent.Time().Int64() + 1
}
// this will ensure we're not going off too far in the future