mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-15 17:30:44 +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
|
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()
|
num := parent.Number()
|
||||||
header := &types.Header{
|
header := &types.Header{
|
||||||
ParentHash: parent.Hash(),
|
ParentHash: parent.Hash(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue