From 82f0bd9009d8d577c86e800e9673a1972117113d Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 12 Feb 2015 11:59:52 +0100 Subject: p2p/discover: code review fixes --- p2p/discover/table.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'p2p/discover/table.go') diff --git a/p2p/discover/table.go b/p2p/discover/table.go index 1ff2c90d9..e3bec9328 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -14,9 +14,9 @@ import ( ) const ( - alpha = 3 // Kademlia concurrency factor - bucketSize = 16 // Kademlia bucket size - nBuckets = len(NodeID{})*8 + 1 // Number of buckets + alpha = 3 // Kademlia concurrency factor + bucketSize = 16 // Kademlia bucket size + nBuckets = nodeIDBits + 1 // Number of buckets ) type Table struct { @@ -100,7 +100,7 @@ func (tab *Table) Lookup(target NodeID) []*Node { tab.mutex.Unlock() for { - // ask the closest nodes that we haven't asked yet + // ask the alpha closest nodes that we haven't asked yet for i := 0; i < len(result.entries) && pendingQueries < alpha; i++ { n := result.entries[i] if !asked[n.ID] { -- cgit v1.2.3