mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
fix(miner): recompute timestamp after sleep (#2052)
This commit is contained in:
parent
338d1b4632
commit
ae6da0583f
1 changed files with 5 additions and 0 deletions
|
|
@ -780,6 +780,11 @@ func (w *worker) commitNewWork() {
|
|||
return
|
||||
}
|
||||
|
||||
// Recalculate timestamp in case the parent changed while sleeping.
|
||||
tstamp = time.Now().Unix()
|
||||
if parent.Time() >= uint64(tstamp) {
|
||||
tstamp = int64(parent.Time() + 1)
|
||||
}
|
||||
num := parent.Number()
|
||||
header := &types.Header{
|
||||
ParentHash: parent.Hash(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue