diff options
Diffstat (limited to 'src/Network/BitTorrent/Peer.hs')
-rw-r--r-- | src/Network/BitTorrent/Peer.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/Peer.hs b/src/Network/BitTorrent/Peer.hs index cdcd65ea..7bac336b 100644 --- a/src/Network/BitTorrent/Peer.hs +++ b/src/Network/BitTorrent/Peer.hs | |||
@@ -196,6 +196,8 @@ timestamp = (BC.pack . format) <$> getCurrentTime | |||
196 | entropy :: IO ByteString | 196 | entropy :: IO ByteString |
197 | entropy = getEntropy 15 | 197 | entropy = getEntropy 15 |
198 | 198 | ||
199 | -- NOTE: entropy generates incorrrect peer id | ||
200 | |||
199 | -- | Here we use Azureus-style encoding with the following args: | 201 | -- | Here we use Azureus-style encoding with the following args: |
200 | -- | 202 | -- |
201 | -- * 'HS' for the client id. | 203 | -- * 'HS' for the client id. |
@@ -205,7 +207,7 @@ entropy = getEntropy 15 | |||
205 | -- * UTC time day ++ day time for the random number. | 207 | -- * UTC time day ++ day time for the random number. |
206 | -- | 208 | -- |
207 | genPeerId :: IO PeerId | 209 | genPeerId :: IO PeerId |
208 | genPeerId = azureusStyle defaultClientId defaultVersionNumber <$> entropy | 210 | genPeerId = azureusStyle defaultClientId defaultVersionNumber <$> timestamp |
209 | 211 | ||
210 | -- | Pad bytestring so it's becomes exactly request length. Conversion | 212 | -- | Pad bytestring so it's becomes exactly request length. Conversion |
211 | -- is done like so: | 213 | -- is done like so: |