aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/evm.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-13 18:20:22 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:50:04 +0800
commitc8d3a2ba9abfc548073eb8e78659fd5a5ce849b5 (patch)
treec5e175a79ef981dfdf1dacafffb5528e9b2c735d /core/vm/evm.go
parent45fe43cf06735c687b971a903872d6e7a6a77167 (diff)
downloaddexon-c8d3a2ba9abfc548073eb8e78659fd5a5ce849b5.tar
dexon-c8d3a2ba9abfc548073eb8e78659fd5a5ce849b5.tar.gz
dexon-c8d3a2ba9abfc548073eb8e78659fd5a5ce849b5.tar.bz2
dexon-c8d3a2ba9abfc548073eb8e78659fd5a5ce849b5.tar.lz
dexon-c8d3a2ba9abfc548073eb8e78659fd5a5ce849b5.tar.xz
dexon-c8d3a2ba9abfc548073eb8e78659fd5a5ce849b5.tar.zst
dexon-c8d3a2ba9abfc548073eb8e78659fd5a5ce849b5.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.go2
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) {