Commit 308299f2 authored by zhiqiangxu's avatar zhiqiangxu Committed by GitHub

remove outOfData variable (#10405)

parent 66202316
...@@ -316,7 +316,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error { ...@@ -316,7 +316,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
if eq.safeAttributes != nil { if eq.safeAttributes != nil {
return eq.tryNextSafeAttributes(ctx) return eq.tryNextSafeAttributes(ctx)
} }
outOfData := false
newOrigin := eq.prev.Origin() newOrigin := eq.prev.Origin()
// Check if the L2 unsafe head origin is consistent with the new origin // Check if the L2 unsafe head origin is consistent with the new origin
if err := eq.verifyNewL1Origin(ctx, newOrigin); err != nil { if err := eq.verifyNewL1Origin(ctx, newOrigin); err != nil {
...@@ -332,7 +332,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error { ...@@ -332,7 +332,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
return err return err
} }
if next, err := eq.prev.NextAttributes(ctx, eq.ec.PendingSafeL2Head()); err == io.EOF { if next, err := eq.prev.NextAttributes(ctx, eq.ec.PendingSafeL2Head()); err == io.EOF {
outOfData = true return io.EOF
} else if err != nil { } else if err != nil {
return err return err
} else { } else {
...@@ -341,12 +341,6 @@ func (eq *EngineQueue) Step(ctx context.Context) error { ...@@ -341,12 +341,6 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
"pending_safe_head", eq.ec.PendingSafeL2Head(), "next", next) "pending_safe_head", eq.ec.PendingSafeL2Head(), "next", next)
return NotEnoughData return NotEnoughData
} }
if outOfData {
return io.EOF
} else {
return nil
}
} }
// verifyNewL1Origin checks that the L2 unsafe head still has a L1 origin that is on the canonical chain. // verifyNewL1Origin checks that the L2 unsafe head still has a L1 origin that is on the canonical chain.
......
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