Merge pull request #492 from XinFinOrg/xdc-05

XDC-05 remove 1s waiting time in miner
This commit is contained in:
wgr523 2024-03-15 05:57:03 -04:00 committed by GitHub
commit 04cf52bead
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -563,7 +563,7 @@ func (self *worker) commitNewWork() {
tstamp = parent.Time().Int64() + 1
}
// this will ensure we're not going off too far in the future
if now := time.Now().Unix(); tstamp > now+1 {
if now := time.Now().Unix(); tstamp > now {
wait := time.Duration(tstamp-now) * time.Second
log.Info("Mining too far in the future", "wait", common.PrettyDuration(wait))
time.Sleep(wait)