mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Update simulated_beacon.go
This commit is contained in:
parent
1240a396d7
commit
fc45fee370
1 changed files with 2 additions and 7 deletions
|
|
@ -128,15 +128,10 @@ func NewSimulatedBeacon(period uint64, feeRecipient common.Address, eth *eth.Eth
|
||||||
|
|
||||||
// cap the dev mode period to a reasonable maximum value to avoid
|
// cap the dev mode period to a reasonable maximum value to avoid
|
||||||
// overflowing the time.Duration (int64) that it will occupy
|
// overflowing the time.Duration (int64) that it will occupy
|
||||||
maxPeriod := uint64(math.MaxInt64 / time.Second)
|
const maxPeriod = math.MaxInt64 / time.Second
|
||||||
if period > maxPeriod {
|
|
||||||
log.Warn("sanitizing period exceeding maximum possible value", "was", period, "now", maxPeriod)
|
|
||||||
period = maxPeriod
|
|
||||||
}
|
|
||||||
|
|
||||||
return &SimulatedBeacon{
|
return &SimulatedBeacon{
|
||||||
eth: eth,
|
eth: eth,
|
||||||
period: period,
|
period: min(period, maxPeriod),
|
||||||
shutdownCh: make(chan struct{}),
|
shutdownCh: make(chan struct{}),
|
||||||
engineAPI: engineAPI,
|
engineAPI: engineAPI,
|
||||||
lastBlockTime: block.Time,
|
lastBlockTime: block.Time,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue