diff options
author | Martin Holst Swende <martin@swende.se> | 2018-08-21 15:48:53 +0800 |
---|---|---|
committer | Martin Holst Swende <martin@swende.se> | 2018-08-21 15:48:53 +0800 |
commit | 106d196ec4a6451efedc60ab15957f231fa85639 (patch) | |
tree | 5d17fcff7127e2bc3a03a3565db1ff746c05bcc0 /eth/api_tracer.go | |
parent | 6d1e292eefa70b5cb76cd03ff61fc6c4550d7c36 (diff) | |
download | go-tangerine-106d196ec4a6451efedc60ab15957f231fa85639.tar go-tangerine-106d196ec4a6451efedc60ab15957f231fa85639.tar.gz go-tangerine-106d196ec4a6451efedc60ab15957f231fa85639.tar.bz2 go-tangerine-106d196ec4a6451efedc60ab15957f231fa85639.tar.lz go-tangerine-106d196ec4a6451efedc60ab15957f231fa85639.tar.xz go-tangerine-106d196ec4a6451efedc60ab15957f231fa85639.tar.zst go-tangerine-106d196ec4a6451efedc60ab15957f231fa85639.zip |
eth: ensure from<to when tracing chain (credits Chen Nan via bugbounty)
Diffstat (limited to 'eth/api_tracer.go')
-rw-r--r-- | eth/api_tracer.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 722e2a6e3..704a6cdba 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -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) } |