Merge pull request #1761 from CJentzsch/patch-3

fix block time issue
(cherry picked from commit e98854588b)
This commit is contained in:
Jeffrey Wilcke 2015-09-02 15:13:14 -07:00 committed by Gustav Simonsson
parent 2d1ea1a66d
commit 19b5f3c1c5
1 changed files with 1 additions and 1 deletions

View File

@ -431,7 +431,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