vm, ethapi: add limit option to traceTransaction

that specifies the maximum number of elements in the `structLogs`
output.  This option is useful for debugging a transaction that
involves a large number of repetition.

For example,
```
debug.traceTransaction(tx, {disableStorage: true, limit: 2})
```
shows at most the first two steps in the `structLogs`.
This commit is contained in:
Yoichi Hirai
2016-09-30 12:22:42 +02:00
parent b4cc8cbac4
commit bb6115b737
4 changed files with 16 additions and 4 deletions

View File

@ -26,3 +26,4 @@ import (
var OutOfGasError = errors.New("Out of gas")
var CodeStoreOutOfGasError = errors.New("Contract creation code storage out of gas")
var DepthError = fmt.Errorf("Max call depth exceeded (%d)", params.CallCreateDepth)
var TraceLimitReachedError = errors.New("The number of logs reached the specified limit")