Commit ac1c8feb authored by hezhengjun's avatar hezhengjun Committed by vipwzw

correct evmDebugEnable set

parent 5644d6a8
...@@ -21,6 +21,7 @@ import ( ...@@ -21,6 +21,7 @@ import (
) )
var ( var (
evmDebugInited = false
// EvmAddress 本合约地址 // EvmAddress 本合约地址
EvmAddress = "" EvmAddress = ""
) )
...@@ -50,10 +51,6 @@ func GetName() string { ...@@ -50,10 +51,6 @@ func GetName() string {
func newEVMDriver() drivers.Driver { func newEVMDriver() drivers.Driver {
evm := NewEVMExecutor() evm := NewEVMExecutor()
cfg := evm.GetAPI().GetConfig()
conf := types.ConfSub(cfg, evmtypes.ExecutorName)
evmDebugEnable := conf.IsEnable("evmDebugEnable")
evm.vmCfg.Debug = evmDebugEnable
return evm return evm
} }
......
...@@ -39,6 +39,11 @@ func (evm *EVMExecutor) innerExec(msg *common.Message, txHash []byte, index int, ...@@ -39,6 +39,11 @@ func (evm *EVMExecutor) innerExec(msg *common.Message, txHash []byte, index int,
// 获取当前区块的上下文信息构造EVM上下文 // 获取当前区块的上下文信息构造EVM上下文
context := evm.NewEVMContext(msg, txHash) context := evm.NewEVMContext(msg, txHash)
cfg := evm.GetAPI().GetConfig() cfg := evm.GetAPI().GetConfig()
if !evmDebugInited {
conf := types.ConfSub(cfg, evmtypes.ExecutorName)
evm.vmCfg.Debug = conf.IsEnable("evmDebugEnable")
evmDebugInited = true
}
// 创建EVM运行时对象 // 创建EVM运行时对象
env := runtime.NewEVM(context, evm.mStateDB, *evm.vmCfg, cfg) env := runtime.NewEVM(context, evm.mStateDB, *evm.vmCfg, cfg)
isCreate := strings.Compare(msg.To().String(), EvmAddress) == 0 && len(msg.Data()) > 0 isCreate := strings.Compare(msg.To().String(), EvmAddress) == 0 && len(msg.Data()) > 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment