diff options
Diffstat (limited to 'src')
-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 | ||