aboutsummaryrefslogtreecommitdiffstats
path: root/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'javascript')
-rw-r--r--javascript/javascript_runtime.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go
index a09aff027..0aa0f73e2 100644
--- a/javascript/javascript_runtime.go
+++ b/javascript/javascript_runtime.go
@@ -14,7 +14,6 @@ import (
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
- "github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
"github.com/obscuren/otto"
@@ -198,19 +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()
}
- idstr, err := call.Argument(0).ToString()
- if err != nil {
- return otto.FalseValue()
- }
- id, err := discover.HexID(idstr)
- if err != nil {
+ if err := self.ethereum.SuggestPeer(nodeURL); err != nil {
return otto.FalseValue()
}
- self.ethereum.SuggestPeer(host, id)
return otto.TrueValue()
}