msgLoop pieceStatus msgchannel
PortMsg _ ->
msgLoop pieceStatus msgchannel
- -- handle RequestMsg, HaveMsg. No need to handle PieceMsg here.
+ HaveMsg idx -> do
+ p <- gets peer
+ let pieceStatus' = updatePieceAvailability pieceStatus p [idx]
+ msgLoop pieceStatus' msgchannel
+ -- handle RequestMsg. No need to handle PieceMsg here.
-- also BitFieldMsg