diff options
-rw-r--r-- | src/Network/BitTorrent/DHT/Routing.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/DHT/Routing.hs b/src/Network/BitTorrent/DHT/Routing.hs index 22076a39..293d58ab 100644 --- a/src/Network/BitTorrent/DHT/Routing.hs +++ b/src/Network/BitTorrent/DHT/Routing.hs | |||
@@ -386,7 +386,8 @@ defaultK = 8 | |||
386 | -- | Get a list of /K/ closest nodes using XOR metric. Used in | 386 | -- | Get a list of /K/ closest nodes using XOR metric. Used in |
387 | -- 'find_node' queries. | 387 | -- 'find_node' queries. |
388 | kclosest :: Eq ip => K -> NodeId -> Table ip -> [NodeInfo ip] | 388 | kclosest :: Eq ip => K -> NodeId -> Table ip -> [NodeInfo ip] |
389 | kclosest k nid = L.map key . PSQ.toList . fromMaybe PSQ.empty | 389 | kclosest k nid = L.take k . rank nid |
390 | . L.map key . PSQ.toList . fromMaybe PSQ.empty | ||
390 | . lookupBucket nid | 391 | . lookupBucket nid |
391 | 392 | ||
392 | coerceId :: (Serialize a, Serialize b) => a -> b | 393 | coerceId :: (Serialize a, Serialize b) => a -> b |