aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/vm.go
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-09-30 18:22:42 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-09-30 23:36:00 +0800
commitbb6115b737a05e3b8bf70ff2ad74c703589627cb (patch)
tree72dc4e8df47729e283735a7a3ecb59930c66b2c5 /core/vm/vm.go
parentb4cc8cbac4c1756c179e497c53ee83515669fe13 (diff)
downloadgo-tangerine-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar
go-tangerine-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.gz
go-tangerine-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.bz2
go-tangerine-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.lz
go-tangerine-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.xz
go-tangerine-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.zst
go-tangerine-bb6115b737a05e3b8bf70ff2ad74c703589627cb.zip
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`.
Diffstat (limited to 'core/vm/vm.go')
-rw-r--r--core/vm/vm.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/vm/vm.go b/core/vm/vm.go
index 9d7b55058..6fee7178c 100644
--- a/core/vm/vm.go
+++ b/core/vm/vm.go
@@ -183,7 +183,10 @@ func (evm *EVM) Run(contract *Contract, input []byte) (ret []byte, err error) {
mem.Resize(newMemSize.Uint64())
// Add a log message
if evm.cfg.Debug {
- evm.cfg.Tracer.CaptureState(evm.env, pc, op, contract.Gas, cost, mem, stack, contract, evm.env.Depth(), nil)
+ err = evm.cfg.Tracer.CaptureState(evm.env, pc, op, contract.Gas, cost, mem, stack, contract, evm.env.Depth(), nil)
+ if err != nil {
+ return nil, err
+ }
}
if opPtr := evm.jumpTable[op]; opPtr.valid {