diff options
Diffstat (limited to 'src/Network/BitTorrent/DHT/Session.hs')
-rw-r--r-- | src/Network/BitTorrent/DHT/Session.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs index 4f861a1e..bc9fda91 100644 --- a/src/Network/BitTorrent/DHT/Session.hs +++ b/src/Network/BitTorrent/DHT/Session.hs | |||
@@ -55,6 +55,7 @@ module Network.BitTorrent.DHT.Session | |||
55 | , getTable | 55 | , getTable |
56 | , getClosest | 56 | , getClosest |
57 | , getSwarms | 57 | , getSwarms |
58 | , allPeers | ||
58 | 59 | ||
59 | -- ** Peer storage | 60 | -- ** Peer storage |
60 | , insertPeer | 61 | , insertPeer |
@@ -408,6 +409,11 @@ getSwarms = do | |||
408 | store <- asks contactInfo >>= liftIO . atomically . readTVar | 409 | store <- asks contactInfo >>= liftIO . atomically . readTVar |
409 | return $ P.knownSwarms store | 410 | return $ P.knownSwarms store |
410 | 411 | ||
412 | allPeers :: Ord ip => InfoHash -> DHT ip [ PeerAddr ip ] | ||
413 | allPeers ih = do | ||
414 | store <- asks contactInfo >>= liftIO . atomically . readTVar | ||
415 | return $ P.lookup ih store | ||
416 | |||
411 | -- | Find a set of closest nodes from routing table of this node. (in | 417 | -- | Find a set of closest nodes from routing table of this node. (in |
412 | -- no particular order) | 418 | -- no particular order) |
413 | -- | 419 | -- |