diff options
Diffstat (limited to 'eth/api_tracer.go')
-rw-r--r-- | eth/api_tracer.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 5b7f168ec..80552ada8 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -391,6 +391,15 @@ func (api *PrivateDebugAPI) TraceBlockFromFile(ctx context.Context, file string, return api.TraceBlock(ctx, blob, config) } +// 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) { + if blocks := api.eth.blockchain.BadBlocks(); index < len(blocks) { + return api.traceBlock(ctx, blocks[index], config) + } + return nil, fmt.Errorf("index out of range") +} + // traceBlock configures a new tracer according to the provided configuration, and // executes all the transactions contained within. The return value will be one item // per transaction, dependent on the requestd tracer. |