mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
eth/catalyst: skip if finalized block is nil
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
7afd003cda
commit
e3bb4044bd
1 changed files with 6 additions and 3 deletions
|
|
@ -176,10 +176,13 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal) error {
|
|||
if payload.Number%devEpochLength == 0 {
|
||||
finalizedHash = payload.BlockHash
|
||||
} else {
|
||||
if block := c.eth.BlockChain().GetBlockByNumber((payload.Number - 1) / devEpochLength * devEpochLength); block != nil {
|
||||
finalizedHash = block.Hash()
|
||||
number := (payload.Number - 1) / devEpochLength * devEpochLength
|
||||
if block := c.eth.BlockChain().GetBlockByNumber(number); block == nil {
|
||||
// Chain rewound after the ForkchoiceUpdate
|
||||
log.Warn("Finalized block not found, skipping", "block", number)
|
||||
return nil
|
||||
} else {
|
||||
finalizedHash = payload.BlockHash
|
||||
finalizedHash = block.Hash()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue