|
|
@@ -192,13 +192,16 @@ func (b *EthAPIBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int {
|
|
|
return b.eth.blockchain.GetTdByHash(hash)
|
|
|
}
|
|
|
|
|
|
-func (b *EthAPIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error) {
|
|
|
+func (b *EthAPIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config, blockContext *vm.BlockContext) (*vm.EVM, func() error, error) {
|
|
|
vmError := func() error { return nil }
|
|
|
if vmConfig == nil {
|
|
|
vmConfig = b.eth.blockchain.GetVMConfig()
|
|
|
}
|
|
|
txContext := core.NewEVMTxContext(msg)
|
|
|
context := core.NewEVMBlockContext(header, b.eth.BlockChain(), nil)
|
|
|
+ if blockContext != nil {
|
|
|
+ context = *blockContext
|
|
|
+ }
|
|
|
return vm.NewEVM(context, txContext, state, b.eth.blockchain.Config(), *vmConfig), vmError, nil
|
|
|
}
|
|
|
|