summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/DHT/ContactInfo.hs
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2017-10-31 19:01:02 +0000
committerJames Crayne <jim.crayne@gmail.com>2017-10-31 19:01:02 +0000
commit08606959a26b9cbc1ceb8c8396c870612004dd38 (patch)
treedbeaba9574baf5655bcc7af31569752c329345d6 /src/Network/BitTorrent/DHT/ContactInfo.hs
parent03ab4e36ade69a953f883d4d6f52f4a023dfda61 (diff)
obsolete cabal conditional dependency & some missing type sigs
Diffstat (limited to 'src/Network/BitTorrent/DHT/ContactInfo.hs')
-rw-r--r--src/Network/BitTorrent/DHT/ContactInfo.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/DHT/ContactInfo.hs b/src/Network/BitTorrent/DHT/ContactInfo.hs
index 89c2ec17..c8187772 100644
--- a/src/Network/BitTorrent/DHT/ContactInfo.hs
+++ b/src/Network/BitTorrent/DHT/ContactInfo.hs
@@ -181,6 +181,7 @@ swarmInsert new old = SwarmData
181 where 181 where
182 newerTimeStamp newtime oldtime = if newtime > oldtime then newtime else oldtime 182 newerTimeStamp newtime oldtime = if newtime > oldtime then newtime else oldtime
183 183
184isSwarmOccupied :: SwarmData -> Bool
184isSwarmOccupied SwarmData{..} = not $ PSQ.null peers 185isSwarmOccupied SwarmData{..} = not $ PSQ.null peers
185 186
186-- | Empty store. 187-- | Empty store.
@@ -207,6 +208,7 @@ instance Serialize PeerStore where
207lookup :: InfoHash -> PeerStore -> [PeerAddr] 208lookup :: InfoHash -> PeerStore -> [PeerAddr]
208lookup ih (PeerStore m) = maybe [] (PSQ.keys . peers) $ HM.lookup ih m 209lookup ih (PeerStore m) = maybe [] (PSQ.keys . peers) $ HM.lookup ih m
209 210
211batchSize :: Int
210batchSize = 64 212batchSize = 64
211 213
212-- | Used in 'get_peers' DHT queries. 214-- | Used in 'get_peers' DHT queries.