only process deposits if merkleizer available (#3774)

`m.depositsChain.blocks.len` may change during `startEth1Syncing`. If
that happened, an additional check now ensures that `scratchMerkleizer`
was initialized before attempting to use it.
This commit is contained in:
Etan Kissling 2022-06-19 07:54:35 +02:00 committed by GitHub
parent afcc5c2ea0
commit 5439978a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1469,7 +1469,7 @@ proc startEth1Syncing(m: Eth1Monitor, delayBeforeStart: Duration) {.async.} =
m.terminalBlockHash = some terminalBlockCandidate.hash m.terminalBlockHash = some terminalBlockCandidate.hash
m.terminalBlockNumber = some terminalBlockCandidate.number m.terminalBlockNumber = some terminalBlockCandidate.number
if shouldProcessDeposits: if shouldProcessDeposits and scratchMerkleizer != nil:
if m.latestEth1BlockNumber <= m.cfg.ETH1_FOLLOW_DISTANCE: if m.latestEth1BlockNumber <= m.cfg.ETH1_FOLLOW_DISTANCE:
continue continue