summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Network/BitTorrent/DHT/Routing.hs3
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.
388kclosest :: Eq ip => K -> NodeId -> Table ip -> [NodeInfo ip] 388kclosest :: Eq ip => K -> NodeId -> Table ip -> [NodeInfo ip]
389kclosest k nid = L.map key . PSQ.toList . fromMaybe PSQ.empty 389kclosest k nid = L.take k . rank nid
390 . L.map key . PSQ.toList . fromMaybe PSQ.empty
390 . lookupBucket nid 391 . lookupBucket nid
391 392
392coerceId :: (Serialize a, Serialize b) => a -> b 393coerceId :: (Serialize a, Serialize b) => a -> b