summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/DHT/ContactInfo.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/DHT/ContactInfo.hs')
-rw-r--r--src/Network/BitTorrent/DHT/ContactInfo.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/DHT/ContactInfo.hs b/src/Network/BitTorrent/DHT/ContactInfo.hs
new file mode 100644
index 00000000..06d2dac0
--- /dev/null
+++ b/src/Network/BitTorrent/DHT/ContactInfo.hs
@@ -0,0 +1,18 @@
1module Network.BitTorrent.DHT.ContactInfo () where
2import Data.HashMap.Strict as HM
3
4import Data.Torrent.InfoHash
5import Network.BitTorrent.Core
6
7-- increase prefix when table is too large
8-- decrease prefix when table is too small
9-- filter outdated peers
10
11data ContactInfo ip = PeerStore
12 { maxSize :: Int
13 , prefixSize :: Int
14 , thisNodeId :: NodeId
15
16 , count :: Int -- ^ Cached size of the 'peerSet'
17 , peerSet :: HashMap InfoHash [PeerAddr ip]
18 }