diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-13 18:20:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-13 18:20:22 +0800 |
commit | 662cccb5ec127969d6e939fad3e95db021822683 (patch) | |
tree | fce48cd9f061cb8752519a5d937a15b7f4b3c0a7 /core/vm/evm.go | |
parent | c1971db86a3a9ea4d56f24ca375d87338c1ca113 (diff) | |
download | dexon-662cccb5ec127969d6e939fad3e95db021822683.tar dexon-662cccb5ec127969d6e939fad3e95db021822683.tar.gz dexon-662cccb5ec127969d6e939fad3e95db021822683.tar.bz2 dexon-662cccb5ec127969d6e939fad3e95db021822683.tar.lz dexon-662cccb5ec127969d6e939fad3e95db021822683.tar.xz dexon-662cccb5ec127969d6e939fad3e95db021822683.tar.zst dexon-662cccb5ec127969d6e939fad3e95db021822683.zip |
core: vm: create new oracle contract instance in each call (#251)
Since the VM might be called from different source (downloader, RPC,
etc.). We need to make the call state separate. Modify the calling
sequence so a new oracle contract instance is used on each run.
Diffstat (limited to 'core/vm/evm.go')
-rw-r--r-- | core/vm/evm.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/vm/evm.go b/core/vm/evm.go index 6b2844020..baf3a0ac9 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -49,7 +49,7 @@ type ( func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, error) { if contract.CodeAddr != nil { if o := OracleContracts[*contract.CodeAddr]; o != nil { - return RunOracleContract(o, evm, input, contract) + return RunOracleContract(o(), evm, input, contract) } precompiles := PrecompiledContractsHomestead if evm.ChainConfig().IsByzantium(evm.BlockNumber) { |