mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
miner: avoid microptimization in favor of cleaner code
This commit is contained in:
parent
73da89d5d8
commit
a0c97fcaed
1 changed files with 0 additions and 4 deletions
|
|
@ -309,10 +309,6 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
|
||||||
next = float64(maxRecommitInterval.Nanoseconds())
|
next = float64(maxRecommitInterval.Nanoseconds())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Short circuit if the interval not larger than the minimal interval specified by user.
|
|
||||||
if recommit <= minRecommit {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
next = prev*(1-intervalAdjustRatio) + intervalAdjustRatio*(target-intervalAdjustBias)
|
next = prev*(1-intervalAdjustRatio) + intervalAdjustRatio*(target-intervalAdjustBias)
|
||||||
// Recap if interval is less than the user specified minimum
|
// Recap if interval is less than the user specified minimum
|
||||||
if next < float64(minRecommit.Nanoseconds()) {
|
if next < float64(minRecommit.Nanoseconds()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue