diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Block.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Exchange/Block.hs b/src/Network/BitTorrent/Exchange/Block.hs index d06fe727..8e3ef91f 100644 --- a/src/Network/BitTorrent/Exchange/Block.hs +++ b/src/Network/BitTorrent/Exchange/Block.hs | |||
@@ -35,6 +35,7 @@ import Control.Applicative | |||
35 | import Data.Aeson.TH | 35 | import Data.Aeson.TH |
36 | import Data.ByteString.Lazy as BL | 36 | import Data.ByteString.Lazy as BL |
37 | import Data.Char | 37 | import Data.Char |
38 | import Data.Default | ||
38 | import Data.List as L | 39 | import Data.List as L |
39 | import Data.Serialize as S | 40 | import Data.Serialize as S |
40 | import Data.Typeable | 41 | import Data.Typeable |
@@ -87,6 +88,10 @@ data BlockIx = BlockIx { | |||
87 | 88 | ||
88 | $(deriveJSON omitRecordPrefix ''BlockIx) | 89 | $(deriveJSON omitRecordPrefix ''BlockIx) |
89 | 90 | ||
91 | -- | First block in torrent. Useful for debugging. | ||
92 | instance Default BlockIx where | ||
93 | def = BlockIx 0 0 defaultTransferSize | ||
94 | |||
90 | getInt :: S.Get Int | 95 | getInt :: S.Get Int |
91 | getInt = fromIntegral <$> S.getWord32be | 96 | getInt = fromIntegral <$> S.getWord32be |
92 | {-# INLINE getInt #-} | 97 | {-# INLINE getInt #-} |