From e221a449e069783ca53fd02716066e66baeae1f0 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 25 May 2015 02:27:37 +0200 Subject: 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. --- rpc/jeth.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rpc') 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) { -- cgit v1.2.3