diff options
author | joe <joe@jerkface.net> | 2017-06-09 01:03:02 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-06-09 01:03:02 -0400 |
commit | ecde95b20167e02092f6a359eac865ba9155614c (patch) | |
tree | 897c37bdf3562a950557b537e4491e99079c00d5 /src/Data | |
parent | 84798bfef62a001ded1bd628d846612f0b0ade80 (diff) |
Started migration away from KRPC class.
Diffstat (limited to 'src/Data')
-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 |