]> git.rkrishnan.org Git - functorrent.git/blobdiff - src/FuncTorrent/Peer.hs
bugfix: Hash string needs to be split into 20 bytes
[functorrent.git] / src / FuncTorrent / Peer.hs
index 62090175fc193dae18ffb39933834fd107e83c1e..b193e43633a4c34ed246fc146a41316053057d61 100644 (file)
@@ -76,7 +76,7 @@ mkPieceMap numPieces pieceHash pLengths = fromList kvs
                              , hash = h
                              , len = pLen })
               | (i, h, pLen) <- zip3 [0..numPieces] hashes pLengths]
-        hashes = splitN (fromIntegral numPieces) pieceHash
+        hashes = splitN 20 pieceHash
 
 havePiece :: PieceMap -> Integer -> Bool
 havePiece pm index =