aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/javascript_runtime.go
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/javascript_runtime.go')
-rw-r--r--javascript/javascript_runtime.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go
index 398daf43a..0aa0f73e2 100644
--- a/javascript/javascript_runtime.go
+++ b/javascript/javascript_runtime.go
@@ -197,12 +197,13 @@ func (self *JSRE) watch(call otto.FunctionCall) otto.Value {
}
func (self *JSRE) addPeer(call otto.FunctionCall) otto.Value {
- host, err := call.Argument(0).ToString()
+ nodeURL, err := call.Argument(0).ToString()
if err != nil {
return otto.FalseValue()
}
- self.ethereum.SuggestPeer(host)
-
+ if err := self.ethereum.SuggestPeer(nodeURL); err != nil {
+ return otto.FalseValue()
+ }
return otto.TrueValue()
}