diff --git a/core/vm/vm.go b/core/vm/vm.go index 3521839df5..1bba6da960 100644 --- a/core/vm/vm.go +++ b/core/vm/vm.go @@ -71,7 +71,7 @@ func (evm *EVM) Run(contract *Contract, input []byte) (ret []byte, err error) { if contract.CodeAddr != nil { if p := Precompiled[contract.CodeAddr.Str()]; p != nil { - return evm.RunPrecompiled(p, input, contract) + return runPrecompiled(p, input, contract) } } @@ -454,12 +454,11 @@ func calculateGasAndSize(gasTable params.GasTable, env *Environment, contract *C return newMemSize, gas, nil } -// RunPrecompile runs and evaluate the output of a precompiled contract defined in contracts.go -func (evm *EVM) RunPrecompiled(p *PrecompiledAccount, input []byte, contract *Contract) (ret []byte, err error) { +// Runs and evaluates the output of a precompiled contract defined in contracts.go +func runPrecompiled(p *PrecompiledAccount, input []byte, contract *Contract) (ret []byte, err error) { gas := p.Gas(len(input)) if contract.UseGas(gas) { ret = p.Call(input) - return ret, nil } else { return nil, OutOfGasError