diff options
author | Paweł Bylica <chfast@gmail.com> | 2018-12-06 21:34:49 +0800 |
---|---|---|
committer | Guillaume Ballet <gballet@gmail.com> | 2018-12-06 21:34:49 +0800 |
commit | de39513ced05f120b30b0daa49003982cc6b2426 (patch) | |
tree | 536d248284c62a0fb913cec44e68daa67a4be51c /core | |
parent | 3ac633ba8423851a85cb909a1f1f0f3c0d2c5351 (diff) | |
download | dexon-de39513ced05f120b30b0daa49003982cc6b2426.tar dexon-de39513ced05f120b30b0daa49003982cc6b2426.tar.gz dexon-de39513ced05f120b30b0daa49003982cc6b2426.tar.bz2 dexon-de39513ced05f120b30b0daa49003982cc6b2426.tar.lz dexon-de39513ced05f120b30b0daa49003982cc6b2426.tar.xz dexon-de39513ced05f120b30b0daa49003982cc6b2426.tar.zst dexon-de39513ced05f120b30b0daa49003982cc6b2426.zip |
core, internal, eth, miner, les: Take VM config from BlockChain (#17955)
Until this commit, when sending an RPC request that called `NewEVM`, a blank `vm.Config`
would be taken so as to set some options, based on the default configuration. If some extra
configuration switches were passed to the blockchain, those would be ignored.
This PR adds a function to get the config from the blockchain, and this is what is now used
for RPC calls.
Some subsequent changes need to be made, see https://github.com/ethereum/go-ethereum/pull/17955#pullrequestreview-182237244
for the details of the discussion.
Diffstat (limited to 'core')
-rw-r--r-- | core/blockchain.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index a672c0ab6..c29063a73 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -210,6 +210,11 @@ func (bc *BlockChain) getProcInterrupt() bool { return atomic.LoadInt32(&bc.procInterrupt) == 1 } +// GetVMConfig returns the block chain VM config. +func (bc *BlockChain) GetVMConfig() *vm.Config { + return &bc.vmConfig +} + // loadLastState loads the last known chain state from the database. This method // assumes that the chain manager mutex is held. func (bc *BlockChain) loadLastState() error { |