Fix key error
authorJaseem Abid <jaseemabid@gmail.com>
Sun, 22 Mar 2015 17:14:43 +0000 (22:44 +0530)
committerJaseem Abid <jaseemabid@gmail.com>
Sun, 22 Mar 2015 17:14:43 +0000 (22:44 +0530)
src/FuncTorrent/Peer.hs

index 105994d2ccdf502bbf3029206f41144f05463dec..bf5c91201e76983e74821d639562cd3e5f6c7e5d 100644 (file)
@@ -37,7 +37,7 @@ toInt = read
 getPeerResponse :: ByteString -> PeerResp
 getPeerResponse body = case decode body of
                         Right (Bdict peerM) ->
-                          let (Just (Bint i)) = lookup (Bstr (pack "lookup")) peerM
+                          let (Just (Bint i)) = lookup (Bstr (pack "interval")) peerM
                               (Bstr peersBS) = peerM ! Bstr (pack "peers")
                               pl = map (\peer -> let (ip', port') = splitAt 4 peer
                                                  in Peer (toIPNum ip') (toPortNum port'))