aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorrjl493456442 <garyrong0905@gmail.com>2017-08-24 11:18:21 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-10-02 20:26:40 +0800
commit94903d572b4ee72c7ea62ce9856f51def85fdd2a (patch)
tree1e9232ff6440cfc68e27c9531e3b5a3819689993 /eth
parentf86c4177d506b635f9ebdaea8ab5aef27f53d20a (diff)
downloaddexon-94903d572b4ee72c7ea62ce9856f51def85fdd2a.tar
dexon-94903d572b4ee72c7ea62ce9856f51def85fdd2a.tar.gz
dexon-94903d572b4ee72c7ea62ce9856f51def85fdd2a.tar.bz2
dexon-94903d572b4ee72c7ea62ce9856f51def85fdd2a.tar.lz
dexon-94903d572b4ee72c7ea62ce9856f51def85fdd2a.tar.xz
dexon-94903d572b4ee72c7ea62ce9856f51def85fdd2a.tar.zst
dexon-94903d572b4ee72c7ea62ce9856f51def85fdd2a.zip
internal, accounts, eth: utilize vm failed flag to help gas estimation
Diffstat (limited to 'eth')
-rw-r--r--eth/api.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/eth/api.go b/eth/api.go
index d64e4e6c7..e91f51bb9 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -523,8 +523,7 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
// Run the transaction with tracing enabled.
vmenv := vm.NewEVM(context, statedb, api.config, vm.Config{Debug: true, Tracer: tracer})
- // TODO utilize failed flag
- ret, gas, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas()))
+ ret, gas, failed, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas()))
if err != nil {
return nil, fmt.Errorf("tracing failed: %v", err)
}
@@ -532,6 +531,7 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
case *vm.StructLogger:
return &ethapi.ExecutionResult{
Gas: gas,
+ Failed: failed,
ReturnValue: fmt.Sprintf("%x", ret),
StructLogs: ethapi.FormatLogs(tracer.StructLogs()),
}, nil