p2p/discover: add node URL functions, distinguish TCP/UDP ports

The discovery RPC protocol does not yet distinguish TCP and UDP ports.
But it can't hurt to do so in our internal model.
This commit is contained in:
Felix Lange
2015-02-06 14:40:53 +01:00
parent 56f777b2fc
commit 8564eb9f7e
8 changed files with 532 additions and 326 deletions

View File

@ -91,8 +91,7 @@ func TestServerDial(t *testing.T) {
// tell the server to connect
tcpAddr := listener.Addr().(*net.TCPAddr)
connAddr := &discover.Node{Addr: &net.UDPAddr{IP: tcpAddr.IP, Port: tcpAddr.Port}}
srv.peerConnect <- connAddr
srv.peerConnect <- &discover.Node{IP: tcpAddr.IP, TCPPort: tcpAddr.Port}
select {
case conn := <-accepted: