From 507ae53d67936e88c71711f74bf4fe03e27d1758 Mon Sep 17 00:00:00 2001 From: Delweng Zheng Date: Wed, 17 Oct 2018 10:26:16 +0800 Subject: [PATCH] Revert "eth: return after ApplyMessage" This reverts commit 9efd4810ea68d1891532c528c4de95f76a27915d. --- eth/api_tracer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/api_tracer.go b/eth/api_tracer.go index cc169f6121..80552ada8c 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -653,6 +653,9 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree // Assemble the transaction call message and return if the requested offset msg, _ := tx.AsMessage(signer) context := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil) + if idx == txIndex { + return msg, context, statedb, nil + } // Not yet the searched for transaction, execute on top of the current state vmenv := vm.NewEVM(context, statedb, api.config, vm.Config{}) if _, _, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas())); err != nil { @@ -660,9 +663,6 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree } // Ensure any modifications are committed to the state statedb.Finalise(true) - if idx == txIndex { - return msg, context, statedb, nil - } } return nil, vm.Context{}, nil, fmt.Errorf("tx index %d out of range for block %x", txIndex, blockHash) }