diff options
author | Felix Lange <fjl@twurst.com> | 2015-05-25 08:27:37 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-05-25 08:27:37 +0800 |
commit | e221a449e069783ca53fd02716066e66baeae1f0 (patch) | |
tree | 03b5465f6d71e79b06befede03976f852d9f9058 /rpc | |
parent | 394826f520f4c34fe11c8e9dc45c5810024a22e2 (diff) | |
download | go-tangerine-e221a449e069783ca53fd02716066e66baeae1f0.tar go-tangerine-e221a449e069783ca53fd02716066e66baeae1f0.tar.gz go-tangerine-e221a449e069783ca53fd02716066e66baeae1f0.tar.bz2 go-tangerine-e221a449e069783ca53fd02716066e66baeae1f0.tar.lz go-tangerine-e221a449e069783ca53fd02716066e66baeae1f0.tar.xz go-tangerine-e221a449e069783ca53fd02716066e66baeae1f0.tar.zst go-tangerine-e221a449e069783ca53fd02716066e66baeae1f0.zip |
cmd/geth, jsre, rpc: run all JS code on the event loop
Some JSRE methods (PrettyPrint, ToVal) bypassed the event loop. All
calls to the JS VM are now wrapped. In order to make this somewhat more
foolproof, the otto VM is now a local variable inside the event loop.
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/jeth.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rpc/jeth.go b/rpc/jeth.go index 2097ac30d..61be60dc7 100644 --- a/rpc/jeth.go +++ b/rpc/jeth.go @@ -3,18 +3,18 @@ package rpc import ( "encoding/json" "fmt" + "github.com/ethereum/go-ethereum/jsre" "github.com/robertkrimen/otto" ) type Jeth struct { ethApi *EthereumApi - toVal func(interface{}) otto.Value re *jsre.JSRE } -func NewJeth(ethApi *EthereumApi, toVal func(interface{}) otto.Value, re *jsre.JSRE) *Jeth { - return &Jeth{ethApi, toVal, re} +func NewJeth(ethApi *EthereumApi, re *jsre.JSRE) *Jeth { + return &Jeth{ethApi, re} } func (self *Jeth) err(call otto.FunctionCall, code int, msg string, id interface{}) (response otto.Value) { |