Redo fix #4588
This commit is contained in:
parent
89dccedcc9
commit
f91fe5646e
|
@ -1819,8 +1819,18 @@ proc stop(m: ELManager) {.async.} =
|
||||||
const
|
const
|
||||||
votedBlocksSafetyMargin = 50
|
votedBlocksSafetyMargin = 50
|
||||||
|
|
||||||
func earliestBlockOfInterest(m: ELManager, latestEth1BlockNumber: Eth1BlockNumber): Eth1BlockNumber =
|
func earliestBlockOfInterest(
|
||||||
latestEth1BlockNumber - (2 * m.cfg.ETH1_FOLLOW_DISTANCE) - votedBlocksSafetyMargin
|
m: ELManager,
|
||||||
|
latestEth1BlockNumber: Eth1BlockNumber): Eth1BlockNumber =
|
||||||
|
let blocksOfInterestRange =
|
||||||
|
SLOTS_PER_ETH1_VOTING_PERIOD +
|
||||||
|
(2 * m.cfg.ETH1_FOLLOW_DISTANCE) +
|
||||||
|
votedBlocksSafetyMargin
|
||||||
|
|
||||||
|
if latestEth1BlockNumber > blocksOfInterestRange:
|
||||||
|
latestEth1BlockNumber - blocksOfInterestRange
|
||||||
|
else:
|
||||||
|
0
|
||||||
|
|
||||||
proc syncBlockRange(m: ELManager,
|
proc syncBlockRange(m: ELManager,
|
||||||
connection: ELConnection,
|
connection: ELConnection,
|
||||||
|
|
Loading…
Reference in New Issue