diff options
Diffstat (limited to 'src/Data/Torrent.hs')
-rw-r--r-- | src/Data/Torrent.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index 1f70aea2..0ce2efd7 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -195,6 +195,8 @@ import System.FilePath | |||
195 | import System.Posix.Types | 195 | import System.Posix.Types |
196 | 196 | ||
197 | import Network.BitTorrent.Address | 197 | import Network.BitTorrent.Address |
198 | import Network.BitTorrent.DHT.Routing | ||
199 | import Network.DatagramServer.Mainline | ||
198 | 200 | ||
199 | 201 | ||
200 | {----------------------------------------------------------------------- | 202 | {----------------------------------------------------------------------- |
@@ -237,6 +239,12 @@ instance BEncode InfoHash where | |||
237 | fromBEncode be = InfoHash <$> fromBEncode be | 239 | fromBEncode be = InfoHash <$> fromBEncode be |
238 | #endif | 240 | #endif |
239 | 241 | ||
242 | instance TableKey KMessageOf InfoHash where | ||
243 | toNodeId = either (error msg) id . S.decode . S.encode | ||
244 | where -- TODO unsafe coerse? | ||
245 | msg = "tableKey: impossible" | ||
246 | |||
247 | |||
240 | -- | Convert to\/from raw bytestring. (no encoding) | 248 | -- | Convert to\/from raw bytestring. (no encoding) |
241 | instance Serialize InfoHash where | 249 | instance Serialize InfoHash where |
242 | put (InfoHash ih) = putByteString ih | 250 | put (InfoHash ih) = putByteString ih |