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 /p2p | |
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 'p2p')
-rw-r--r-- | p2p/server.go | 4 | ||||
-rw-r--r-- | p2p/server_test.go | 2 |
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: |