Commit da68567e authored by Sebastian Stammler's avatar Sebastian Stammler Committed by GitHub

op-wheel: harden against missing safe/finalized heads (#11460)

parent 0c426483
...@@ -405,10 +405,10 @@ func Rewind(ctx context.Context, lgr log.Logger, client *sources.EngineAPIClient ...@@ -405,10 +405,10 @@ func Rewind(ctx context.Context, lgr log.Logger, client *sources.EngineAPIClient
// when rewinding, don't increase unsafe/finalized tags // when rewinding, don't increase unsafe/finalized tags
toSafe, toFinalized := toUnsafe, toUnsafe toSafe, toFinalized := toUnsafe, toUnsafe
if safe.Number.Uint64() < to { if safe != nil && safe.Number.Uint64() < to {
toSafe = eth.HeaderBlockID(safe) toSafe = eth.HeaderBlockID(safe)
} }
if finalized.Number.Uint64() < to { if finalized != nil && finalized.Number.Uint64() < to {
toFinalized = eth.HeaderBlockID(finalized) toFinalized = eth.HeaderBlockID(finalized)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment