mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
fix block time issue
currently, under normal circumstances, you always set the timestamp to previous.Time() + 1.
This commit is contained in:
parent
8f09242d7f
commit
20c8f17a8f
1 changed files with 1 additions and 1 deletions
|
|
@ -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)) != -1 {
|
||||
tstamp = parent.Time().Int64() + 1
|
||||
}
|
||||
// this will ensure we're not going off too far in the future
|
||||
|
|
|
|||
Loading…
Reference in a new issue