diff options
Diffstat (limited to 'src/Network/Tox/DHT')
-rw-r--r-- | src/Network/Tox/DHT/Transport.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Network/Tox/DHT/Transport.hs b/src/Network/Tox/DHT/Transport.hs index 5bd9caa1..0787c2c1 100644 --- a/src/Network/Tox/DHT/Transport.hs +++ b/src/Network/Tox/DHT/Transport.hs | |||
@@ -43,6 +43,7 @@ import Data.Monoid | |||
43 | import Data.Serialize as S | 43 | import Data.Serialize as S |
44 | import Data.Tuple | 44 | import Data.Tuple |
45 | import Data.Word | 45 | import Data.Word |
46 | import Foreign.C (CTime(..)) | ||
46 | import Network.Socket | 47 | import Network.Socket |
47 | 48 | ||
48 | type DHTTransport = Transport String NodeInfo (DHTMessage Encrypted8) | 49 | type DHTTransport = Transport String NodeInfo (DHTMessage Encrypted8) |
@@ -201,7 +202,11 @@ instance Serialize DHTRequest where | |||
201 | -- | `32` | Our DHT public key | | 202 | -- | `32` | Our DHT public key | |
202 | -- | `[39, 204]` | Maximum of 4 nodes in packed format | | 203 | -- | `[39, 204]` | Maximum of 4 nodes in packed format | |
203 | data DHTPublicKey = DHTPublicKey | 204 | data DHTPublicKey = DHTPublicKey |
204 | { dhtpkNonce :: Nonce8 -- no_replay | 205 | { dhtpkNonce :: Word64 -- ^ The `no_replay` number is protection if |
206 | -- someone tries to replay an older packet and | ||
207 | -- should be set to an always increasing number. | ||
208 | -- It is 8 bytes so you should set a high | ||
209 | -- resolution monotonic time as the value. | ||
205 | , dhtpk :: PublicKey -- dht public key | 210 | , dhtpk :: PublicKey -- dht public key |
206 | , dhtpkNodes :: SendNodes -- other reachable nodes | 211 | , dhtpkNodes :: SendNodes -- other reachable nodes |
207 | } | 212 | } |