aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
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 /p2p
parente34d1341022a51d8a86c4836c91e4e0ded888d27 (diff)
downloaddexon-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.gz
dexon-2cf4fed11b01bb99e08b838f7df2b9396f42f758.tar.zst
dexon-2cf4fed11b01bb99e08b838f7df2b9396f42f758.zip
cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestions
Diffstat (limited to 'p2p')
-rw-r--r--p2p/server.go4
-rw-r--r--p2p/server_test.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/p2p/server.go b/p2p/server.go
index c6d7fc2e8..bb3101485 100644
--- a/p2p/server.go
+++ b/p2p/server.go
@@ -135,8 +135,8 @@ func (srv *Server) PeerCount() int {
// SuggestPeer creates a connection to the given Node if it
// is not already connected.
-func (srv *Server) SuggestPeer(ip net.IP, port int, id discover.NodeID) {
- srv.peerConnect <- &discover.Node{ID: id, IP: ip, TCPPort: port}
+func (srv *Server) SuggestPeer(n *discover.Node) {
+ srv.peerConnect <- n
}
// Broadcast sends an RLP-encoded message to all connected peers.
diff --git a/p2p/server_test.go b/p2p/server_test.go
index d1e1640fb..aa2b3d243 100644
--- a/p2p/server_test.go
+++ b/p2p/server_test.go
@@ -91,7 +91,7 @@ func TestServerDial(t *testing.T) {
// tell the server to connect
tcpAddr := listener.Addr().(*net.TCPAddr)
- srv.peerConnect <- &discover.Node{IP: tcpAddr.IP, TCPPort: tcpAddr.Port}
+ srv.SuggestPeer(&discover.Node{IP: tcpAddr.IP, TCPPort: tcpAddr.Port})
select {
case conn := <-accepted: