diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-02-04 06:46:27 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-03-24 06:02:42 +0800 |
commit | 14013372aeca2d7f1d8c3a87b7df7c27868314be (patch) | |
tree | d4951dbe1d7f1b25b4bbde786b14b5b0b6107bcc /eth | |
parent | 342ae7ce7dfd7a0eab2dd06bfa65199825279f05 (diff) | |
download | dexon-14013372aeca2d7f1d8c3a87b7df7c27868314be.tar.gz dexon-14013372aeca2d7f1d8c3a87b7df7c27868314be.tar.zst dexon-14013372aeca2d7f1d8c3a87b7df7c27868314be.zip |
core: Added EVM configuration options
The EVM is now initialised with an additional configured object that
allows you to turn on debugging options.
Diffstat (limited to 'eth')
-rw-r--r-- | eth/api.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/eth/api.go b/eth/api.go index 487d24ae7..beae3aabb 100644 --- a/eth/api.go +++ b/eth/api.go @@ -667,7 +667,7 @@ func (s *PublicBlockChainAPI) doCall(args CallArgs, blockNr rpc.BlockNumber) (st } // Execute the call and return - vmenv := core.NewEnv(stateDb, s.bc, msg, block.Header()) + vmenv := core.NewEnv(stateDb, s.bc, msg, block.Header(), nil) gp := new(core.GasPool).AddGas(common.MaxBig) res, gas, err := core.ApplyMessage(vmenv, msg, gp) @@ -1513,9 +1513,6 @@ func (api *PrivateDebugAPI) ProcessBlock(number uint64) (bool, error) { if block == nil { return false, fmt.Errorf("block #%d not found", number) } - // Temporarily enable debugging - defer func(old bool) { vm.Debug = old }(vm.Debug) - vm.Debug = true // Validate and reprocess the block var ( @@ -1530,7 +1527,7 @@ func (api *PrivateDebugAPI) ProcessBlock(number uint64) (bool, error) { if err != nil { return false, err } - receipts, _, usedGas, err := processor.Process(block, statedb) + receipts, _, usedGas, err := processor.Process(block, statedb, nil) if err != nil { return false, err } @@ -1601,10 +1598,8 @@ func (s *PrivateDebugAPI) doReplayTransaction(txHash common.Hash) ([]vm.StructLo data: tx.Data(), } - vmenv := core.NewEnv(stateDb, s.eth.BlockChain(), msg, block.Header()) + vmenv := core.NewEnv(stateDb, s.eth.BlockChain(), msg, block.Header(), nil) gp := new(core.GasPool).AddGas(block.GasLimit()) - vm.GenerateStructLogs = true - defer func() { vm.GenerateStructLogs = false }() ret, gas, err := core.ApplyMessage(vmenv, msg, gp) if err != nil { |