mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
eth: more elegant api_tracer
This commit is contained in:
parent
4727670df7
commit
f616a39b6a
1 changed files with 2 additions and 3 deletions
|
|
@ -394,9 +394,8 @@ func (api *PrivateDebugAPI) TraceBlockFromFile(ctx context.Context, file string,
|
|||
// TraceBadBlock returns the structured logs created during the execution of a block
|
||||
// within the blockchain 'badblocks' cache
|
||||
func (api *PrivateDebugAPI) TraceBadBlock(ctx context.Context, index int, config *TraceConfig) ([]*txTraceResult, error) {
|
||||
badBlocks := api.eth.blockchain.BadBlocks()
|
||||
if l := len(badBlocks); index < l {
|
||||
return api.traceBlock(ctx, badBlocks[index], config)
|
||||
if blocks := api.eth.blockchain.BadBlocks(); index < len(blocks) {
|
||||
return api.traceBlock(ctx, blocks[index], config)
|
||||
}
|
||||
return nil, fmt.Errorf("index out of range")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue