diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-28 05:46:05 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-28 05:46:05 +0400 |
commit | fe6cb6e8a5de55406ad3663cf5c0a0d73189a519 (patch) | |
tree | cc74b60782f734ba3e6fee0ee6b7cb136738ea3f /src/Network/BitTorrent/Core/Node.hs | |
parent | 4f8ad2b2c63a056f924883f7d26f58b08b37d44b (diff) |
Remove unused node list serialization
Diffstat (limited to 'src/Network/BitTorrent/Core/Node.hs')
-rw-r--r-- | src/Network/BitTorrent/Core/Node.hs | 19 |
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 | |||
109 | data NodeAddr a = NodeAddr | 109 | data 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 | |||
165 | instance Serialize a => Serialize (NodeInfo a) where | 165 | instance 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 | {- | ||
169 | type CompactInfo = ByteString | ||
170 | |||
171 | data NodeList a = CompactNodeList [NodeInfo a] | ||
172 | |||
173 | decodeCompact :: Serialize a => CompactInfo -> [NodeInfo a] | ||
174 | decodeCompact = either (const []) id . S.runGet (many get) | ||
175 | |||
176 | encodeCompact :: [NodeId] -> CompactInfo | ||
177 | encodeCompact = 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 | ||