aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-02-07 07:15:04 +0800
committerFelix Lange <fjl@twurst.com>2015-02-07 07:46:56 +0800
commit2cf4fed11b01bb99e08b838f7df2b9396f42f758 (patch)
treec4c6a63adeaa80f9b3150cf7e58d0bdcbf05bb28 /eth
parente34d1341022a51d8a86c4836c91e4e0ded888d27 (diff)
downloadgo-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar
go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.gz
go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.bz2
go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.lz
go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.xz
go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.zst
go-tangerine-2cf4fed11b01bb99e08b838f7df2b9396f42f758.zip
cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestions
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 08052c15d..6cf2069d7 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -2,7 +2,6 @@ package eth
import (
"fmt"
- "net"
"sync"
"github.com/ethereum/go-ethereum/core"
@@ -241,13 +240,12 @@ func (s *Ethereum) Start(seedNode string) error {
return nil
}
-func (self *Ethereum) SuggestPeer(addr string, id discover.NodeID) error {
- netaddr, err := net.ResolveTCPAddr("tcp", addr)
+func (self *Ethereum) SuggestPeer(nodeURL string) error {
+ n, err := discover.ParseNode(nodeURL)
if err != nil {
- logger.Errorf("couldn't resolve %s:", addr, err)
- return err
+ return fmt.Errorf("invalid node URL: %v", err)
}
- self.net.SuggestPeer(netaddr.IP, netaddr.Port, id)
+ self.net.SuggestPeer(n)
return nil
}