Skip to content

Commit

Permalink
eth: ensure from<to when tracing chain (credits Chen Nan via bugbounty)
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Aug 21, 2018
1 parent 6d1e292 commit 106d196
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 @@ -119,6 +119,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 106d196

Please # to comment.