aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/table_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-04-18 07:50:31 +0800
committerFelix Lange <fjl@twurst.com>2015-04-30 20:57:33 +0800
commitfc747ef4a649cd90aec5193a8af6b7accb5eb03f (patch)
treeb81f4b1fb00abd2bf05b4d586b0b3f08d2011cd5 /p2p/discover/table_test.go
parent3fef60190384106af390dd23a65384b9cc6e4a28 (diff)
downloaddexon-fc747ef4a649cd90aec5193a8af6b7accb5eb03f.tar.gz
dexon-fc747ef4a649cd90aec5193a8af6b7accb5eb03f.tar.zst
dexon-fc747ef4a649cd90aec5193a8af6b7accb5eb03f.zip
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.
Diffstat (limited to 'p2p/discover/table_test.go')
-rw-r--r--p2p/discover/table_test.go4
1 files changed, 2 insertions, 2 deletions
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