Skip to content

Commit ecca49e

Browse files
authored
Merge pull request #17460 from holiman/tracerfix
Ensure from < to when tracing chain
2 parents 7d38d53 + 106d196 commit ecca49e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎eth/api_tracer.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ func (api *PrivateDebugAPI) TraceChain(ctx context.Context, start, end rpc.Block
119119
if to == nil {
120120
return nil, fmt.Errorf("end block #%d not found", end)
121121
}
122+
if from.Number().Cmp(to.Number()) >= 0 {
123+
return nil, fmt.Errorf("end block (#%d) needs to come after start block (#%d)", end, start)
124+
}
122125
return api.traceChain(ctx, from, to, config)
123126
}
124127

0 commit comments

Comments
 (0)