mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 11:36:37 +00:00
eth: ensure from<to when tracing chain (credits Chen Nan via bugbounty)
This commit is contained in:
parent
6d1e292eef
commit
106d196ec4
1 changed files with 3 additions and 0 deletions
|
|
@ -119,6 +119,9 @@ func (api *PrivateDebugAPI) TraceChain(ctx context.Context, start, end rpc.Block
|
||||||
if to == nil {
|
if to == nil {
|
||||||
return nil, fmt.Errorf("end block #%d not found", end)
|
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)
|
return api.traceChain(ctx, from, to, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue