aboutsummaryrefslogtreecommitdiff
path: root/miner
diff options
context:
space:
mode:
authoraaronbuchwald <[email protected]>2020-12-17 17:13:04 -0500
committerGitHub <[email protected]>2020-12-17 17:13:04 -0500
commit374b401198759f23bac435a78c5b1fa2c516aad9 (patch)
treef3d33fa99fc7d46dd2836bef500d8a1cf445e094 /miner
parentc765f9b5b38d3e4b5f4261d3c4ab776dd9c3c97a (diff)
parent72f10d245f5514de4f586ca97784d599d00cc8f3 (diff)
Merge pull request #72 from ava-labs/devHEADv0.3.17master
Dev
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 72597b0..2b44691 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -913,12 +913,15 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
//timestamp = int64(parent.Time() + 1)
timestamp = int64(parent.Time())
}
- // this will ensure we're not going off too far in the future
- if now := time.Now().Unix(); timestamp > now+1 {
- wait := time.Duration(timestamp-now) * time.Second
- log.Info("Mining too far in the future", "wait", common.PrettyDuration(wait))
- time.Sleep(wait)
- }
+ // This block has been removed to prevent BuildBlock
+ // from blocking until this chain advances to timestamp
+ // This prevents a block issued up to 30s in the future
+ // from causing an unnecessary sleep
+ // if now := time.Now().Unix(); timestamp > now+1 {
+ // wait := time.Duration(timestamp-now) * time.Second
+ // log.Info("Mining too far in the future", "wait", common.PrettyDuration(wait))
+ // time.Sleep(wait)
+ // }
num := parent.Number()
header := &types.Header{