mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Apply suggestions from code review
This commit is contained in:
parent
e4c48d1638
commit
1240a396d7
1 changed files with 3 additions and 2 deletions
|
|
@ -126,10 +126,11 @@ func NewSimulatedBeacon(period uint64, feeRecipient common.Address, eth *eth.Eth
|
|||
}
|
||||
}
|
||||
|
||||
// cap the dev mode period to a reasonable maximum value to avoid overflowing the time.Duration (int64) that it will occupy
|
||||
// cap the dev mode period to a reasonable maximum value to avoid
|
||||
// overflowing the time.Duration (int64) that it will occupy
|
||||
maxPeriod := uint64(math.MaxInt64 / time.Second)
|
||||
if period > maxPeriod {
|
||||
log.Warn(fmt.Sprintf("period exceeds maximum possible value (have: %d, max: %d). Sanitizing period to maximum possible value.", period, maxPeriod))
|
||||
log.Warn("sanitizing period exceeding maximum possible value", "was", period, "now", maxPeriod)
|
||||
period = maxPeriod
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue