diff options
author | Felix Lange <fjl@twurst.com> | 2015-02-07 07:15:04 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-02-07 07:46:56 +0800 |
commit | 2cf4fed11b01bb99e08b838f7df2b9396f42f758 (patch) | |
tree | c4c6a63adeaa80f9b3150cf7e58d0bdcbf05bb28 /javascript | |
parent | e34d1341022a51d8a86c4836c91e4e0ded888d27 (diff) | |
download | go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.gz go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.zst go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.zip |
cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestions
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/javascript_runtime.go | 11 |
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() } |