From b8f976b3df0af5d27f926022d7c7624609fc1072 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sat, 11 Jan 2014 08:49:40 +0400 Subject: Add documentation to peer store section --- src/Network/BitTorrent/DHT/Message.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Network/BitTorrent/DHT/Message.hs') diff --git a/src/Network/BitTorrent/DHT/Message.hs b/src/Network/BitTorrent/DHT/Message.hs index acecf8b1..7bcd00f0 100644 --- a/src/Network/BitTorrent/DHT/Message.hs +++ b/src/Network/BitTorrent/DHT/Message.hs @@ -73,6 +73,7 @@ module Network.BitTorrent.DHT.Message , NodeFound (..) -- ** get_peers + , PeerList , GetPeers (..) , GotPeers (..) @@ -216,11 +217,13 @@ instance BEncode GetPeers where toBEncode (GetPeers ih) = toDict $ info_hash_key .=! ih .: endDict fromBEncode = fromDict $ GetPeers <$>! info_hash_key +type PeerList ip = Either [NodeInfo ip] [PeerAddr ip] + data GotPeers ip = GotPeers { -- | If the queried node has no peers for the infohash, returned -- the K nodes in the queried nodes routing table closest to the -- infohash supplied in the query. - peers :: Either [NodeInfo ip] [PeerAddr ip] + peers :: PeerList ip -- | The token value is a required argument for a future -- announce_peer query. -- cgit v1.2.3