diff options
author | Felix Lange <fjl@twurst.com> | 2015-02-05 10:16:16 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-02-06 07:03:59 +0800 |
commit | 56f777b2fc77275bc636562b66a08b19afe2ec56 (patch) | |
tree | c9a34bd23e13adb0d850957b9a66cd748d34b3e3 /cmd/mist/ui_lib.go | |
parent | 8e8ec8f5f8974aafeac5e4a9ead76878fe22cefd (diff) | |
download | go-tangerine-56f777b2fc77275bc636562b66a08b19afe2ec56.tar.gz go-tangerine-56f777b2fc77275bc636562b66a08b19afe2ec56.tar.zst go-tangerine-56f777b2fc77275bc636562b66a08b19afe2ec56.zip |
cmd/ethereum, cmd/mist, core, eth, javascript, xeth: fixes for new p2p API
Diffstat (limited to 'cmd/mist/ui_lib.go')
-rw-r--r-- | cmd/mist/ui_lib.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go index 7c5802076..2e557dba9 100644 --- a/cmd/mist/ui_lib.go +++ b/cmd/mist/ui_lib.go @@ -31,6 +31,7 @@ import ( "github.com/ethereum/go-ethereum/event/filter" "github.com/ethereum/go-ethereum/javascript" "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/xeth" "github.com/obscuren/qml" ) @@ -142,8 +143,13 @@ func (ui *UiLib) Connect(button qml.Object) { } } -func (ui *UiLib) ConnectToPeer(addr string) { - if err := ui.eth.SuggestPeer(addr); err != nil { +func (ui *UiLib) ConnectToPeer(addr string, hexid string) { + id, err := discover.HexID(hexid) + if err != nil { + guilogger.Errorf("bad node ID: %v", err) + return + } + if err := ui.eth.SuggestPeer(addr, id); err != nil { guilogger.Infoln(err) } } |