summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Network/BitTorrent/Exchange/Block.hs5
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
35import Data.Aeson.TH 35import Data.Aeson.TH
36import Data.ByteString.Lazy as BL 36import Data.ByteString.Lazy as BL
37import Data.Char 37import Data.Char
38import Data.Default
38import Data.List as L 39import Data.List as L
39import Data.Serialize as S 40import Data.Serialize as S
40import Data.Typeable 41import 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.
92instance Default BlockIx where
93 def = BlockIx 0 0 defaultTransferSize
94
90getInt :: S.Get Int 95getInt :: S.Get Int
91getInt = fromIntegral <$> S.getWord32be 96getInt = fromIntegral <$> S.getWord32be
92{-# INLINE getInt #-} 97{-# INLINE getInt #-}