From: Jaseem Abid Date: Sun, 22 Mar 2015 17:14:43 +0000 (+0530) Subject: Fix key error X-Git-Url: https://git.rkrishnan.org/?p=functorrent.git;a=commitdiff_plain;h=9a49270d9b177ed5ac2239e4381e343eaa051cc1 Fix key error --- diff --git a/src/FuncTorrent/Peer.hs b/src/FuncTorrent/Peer.hs index 105994d..bf5c912 100644 --- a/src/FuncTorrent/Peer.hs +++ b/src/FuncTorrent/Peer.hs @@ -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'))