diff options
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r-- | src/Network/BitTorrent/DHT/ContactInfo.hs | 18 |
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 @@ | |||
1 | module Network.BitTorrent.DHT.ContactInfo () where | ||
2 | import Data.HashMap.Strict as HM | ||
3 | |||
4 | import Data.Torrent.InfoHash | ||
5 | import 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 | |||
11 | data 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 | } | ||