From fc747ef4a649cd90aec5193a8af6b7accb5eb03f Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 18 Apr 2015 01:50:31 +0200 Subject: p2p/discover: new endpoint format This commit changes the discovery protocol to use the new "v4" endpoint format, which allows for separate UDP and TCP ports and makes it possible to discover the UDP address after NAT. --- p2p/discover/table_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'p2p/discover/table_test.go') diff --git a/p2p/discover/table_test.go b/p2p/discover/table_test.go index e2bd3c8ad..e7394756d 100644 --- a/p2p/discover/table_test.go +++ b/p2p/discover/table_test.go @@ -261,9 +261,9 @@ func (t findnodeOracle) findnode(toid NodeID, toaddr *net.UDPAddr, target NodeID panic("query to node at distance 0") default: // TODO: add more randomness to distances - next := toaddr.Port - 1 + next := uint16(toaddr.Port) - 1 for i := 0; i < bucketSize; i++ { - result = append(result, &Node{ID: randomID(t.target, next), DiscPort: next}) + result = append(result, &Node{ID: randomID(t.target, int(next)), UDP: next}) } } return result, nil -- cgit v1.2.3