From 2cf4fed11b01bb99e08b838f7df2b9396f42f758 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 7 Feb 2015 00:15:04 +0100 Subject: cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestions --- javascript/javascript_runtime.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'javascript/javascript_runtime.go') 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() } -- cgit v1.2.3