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