summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-12-28 05:46:05 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-12-28 05:46:05 +0400
commitfe6cb6e8a5de55406ad3663cf5c0a0d73189a519 (patch)
treecc74b60782f734ba3e6fee0ee6b7cb136738ea3f /src/Network/BitTorrent
parent4f8ad2b2c63a056f924883f7d26f58b08b37d44b (diff)
Remove unused node list serialization
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r--src/Network/BitTorrent/Core/Node.hs19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/Network/BitTorrent/Core/Node.hs b/src/Network/BitTorrent/Core/Node.hs
index f163a895..9501d59e 100644
--- a/src/Network/BitTorrent/Core/Node.hs
+++ b/src/Network/BitTorrent/Core/Node.hs
@@ -109,7 +109,7 @@ genNodeId = NodeId <$> getEntropy nodeIdSize
109data NodeAddr a = NodeAddr 109data NodeAddr a = NodeAddr
110 { nodeHost :: !a 110 { nodeHost :: !a
111 , nodePort :: {-# UNPACK #-} !PortNumber 111 , nodePort :: {-# UNPACK #-} !PortNumber
112 } deriving (Show, Eq) 112 } deriving (Show, Eq, Typeable)
113 113
114$(deriveJSON omitRecordPrefix ''NodeAddr) 114$(deriveJSON omitRecordPrefix ''NodeAddr)
115 115
@@ -165,20 +165,3 @@ instance Eq a => Ord (NodeInfo a) where
165instance Serialize a => Serialize (NodeInfo a) where 165instance Serialize a => Serialize (NodeInfo a) where
166 get = NodeInfo <$> get <*> get 166 get = NodeInfo <$> get <*> get
167 put NodeInfo {..} = put nodeId >> put nodeAddr 167 put NodeInfo {..} = put nodeId >> put nodeAddr
168{-
169type CompactInfo = ByteString
170
171data NodeList a = CompactNodeList [NodeInfo a]
172
173decodeCompact :: Serialize a => CompactInfo -> [NodeInfo a]
174decodeCompact = either (const []) id . S.runGet (many get)
175
176encodeCompact :: [NodeId] -> CompactInfo
177encodeCompact = S.runPut . mapM_ put
178
179--decodePeerList :: [BEncode] -> [PeerAddr]
180--decodePeerList = undefined
181
182--encodePeerList :: [PeerAddr] -> [BEncode]
183--encodePeerList = undefined
184-} \ No newline at end of file