From 3f221d6882bc9e75251d450e3833d4e815611324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 26 Oct 2018 13:50:54 +0200 Subject: [PATCH] core/vm: Allow using EVMC also as an EVM --- core/vm/evm.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/vm/evm.go b/core/vm/evm.go index 15dd4a926d91..7944d5bb93ad 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -147,8 +147,12 @@ func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmCon } } - // vmConfig.EVMInterpreter will be used by EVM-C, it won't be checked here - // as we always want to have the built-in EVM as the failover option. + if vmConfig.EVMInterpreter != "" { + // Create custom EVM. + evm.interpreters = append(evm.interpreters, NewEVMC(vmConfig.EVMInterpreter, evm)) + } + + // Keep the built-in EVM as the failover option. evm.interpreters = append(evm.interpreters, NewEVMInterpreter(evm, vmConfig)) return evm