aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
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: