aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2016-02-04 06:46:27 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-03-24 06:02:42 +0800
commit14013372aeca2d7f1d8c3a87b7df7c27868314be (patch)
treed4951dbe1d7f1b25b4bbde786b14b5b0b6107bcc /eth/api.go
parent342ae7ce7dfd7a0eab2dd06bfa65199825279f05 (diff)
downloadgo-tangerine-14013372aeca2d7f1d8c3a87b7df7c27868314be.tar
go-tangerine-14013372aeca2d7f1d8c3a87b7df7c27868314be.tar.gz
go-tangerine-14013372aeca2d7f1d8c3a87b7df7c27868314be.tar.bz2
go-tangerine-14013372aeca2d7f1d8c3a87b7df7c27868314be.tar.lz
go-tangerine-14013372aeca2d7f1d8c3a87b7df7c27868314be.tar.xz
go-tangerine-14013372aeca2d7f1d8c3a87b7df7c27868314be.tar.zst
go-tangerine-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/api.go')
-rw-r--r--eth/api.go11
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 {