fileName = name (info m)
pieceStatus = mkPieceMap numPieces pieceHash (splitNum fileLen pLen)
createDummyFile fileName (fromIntegral fileLen)
- (r, _) <- runStateT (msgLoop pieceStatus fileName) pstate
+ _ <- runStateT (msgLoop pieceStatus fileName) pstate
return ()
msgLoop :: PieceMap -> FilePath -> StateT PState IO ()
gets peer >>= (\p -> liftIO $ putStrLn $ "--> InterestedMsg to peer: " ++ show p)
modify (\st -> st { meInterested = True })
msgLoop pieceStatus file
- PState { meInterested = True, heChoking = False } -> do
+ PState { meInterested = True, heChoking = False } ->
case pickPiece pieceStatus of
Nothing -> liftIO $ putStrLn "Nothing to download"
Just workPiece -> do