Skip to content

Commit

Permalink
eth: ensure from<to when tracing chain (credits Chen Nan via bugbount…
Browse files Browse the repository at this point in the history
…y) (ethereum#251)

Co-authored-by: Martin Holst Swende <[email protected]>
  • Loading branch information
wgr523 and holiman authored May 25, 2023
1 parent 62de42d commit 2f10aac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions eth/api_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func (api *PrivateDebugAPI) TraceChain(ctx context.Context, start, end rpc.Block
if to == nil {
return nil, fmt.Errorf("end block #%d not found", end)
}
if from.Number().Cmp(to.Number()) >= 0 {
return nil, fmt.Errorf("end block (#%d) needs to come after start block (#%d)", end, start)
}
return api.traceChain(ctx, from, to, config)
}

Expand Down

0 comments on commit 2f10aac

Please sign in to comment.