summaryrefslogtreecommitdiff
path: root/src/Network/Tox/DHT/Transport.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/Tox/DHT/Transport.hs')
-rw-r--r--src/Network/Tox/DHT/Transport.hs7
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
43import Data.Serialize as S 43import Data.Serialize as S
44import Data.Tuple 44import Data.Tuple
45import Data.Word 45import Data.Word
46import Foreign.C (CTime(..))
46import Network.Socket 47import Network.Socket
47 48
48type DHTTransport = Transport String NodeInfo (DHTMessage Encrypted8) 49type 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 |
203data DHTPublicKey = DHTPublicKey 204data 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 }