diff options
author | Joe Crayne <joe@jerkface.net> | 2018-12-08 23:30:48 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2018-12-16 14:08:26 -0500 |
commit | 0dd2f5e5d078b735760e097df4204f9778bb193d (patch) | |
tree | a752a8f9e97e1aac44b641c928e8d7d32a7178d9 /src/Network/Kademlia | |
parent | df6292eef942c11b9ac58b337f29641dae404116 (diff) |
Integrated cli interface to TCP Kademlia table.
Diffstat (limited to 'src/Network/Kademlia')
-rw-r--r-- | src/Network/Kademlia/Bootstrap.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Network/Kademlia/Bootstrap.hs b/src/Network/Kademlia/Bootstrap.hs index aad8a81e..0f5d4e4d 100644 --- a/src/Network/Kademlia/Bootstrap.hs +++ b/src/Network/Kademlia/Bootstrap.hs | |||
@@ -77,14 +77,14 @@ data BucketRefresher nid ni = forall tok addr. Ord addr => BucketRefresher | |||
77 | 77 | ||
78 | newBucketRefresher :: ( Ord addr, Hashable addr | 78 | newBucketRefresher :: ( Ord addr, Hashable addr |
79 | , SensibleNodeId nid ni ) | 79 | , SensibleNodeId nid ni ) |
80 | => ni | 80 | => TVar (R.BucketList ni) |
81 | -> Search nid addr tok ni ni | 81 | -> Search nid addr tok ni ni |
82 | -> (ni -> IO Bool) | 82 | -> (ni -> IO Bool) |
83 | -> STM (BucketRefresher nid ni) | 83 | -> STM (BucketRefresher nid ni) |
84 | newBucketRefresher template_ni sch ping = do | 84 | newBucketRefresher bkts sch ping = do |
85 | let spc = searchSpace sch | 85 | let spc = searchSpace sch |
86 | nodeId = kademliaLocation spc | 86 | nodeId = kademliaLocation spc |
87 | bkts <- newTVar $ R.nullTable (comparing nodeId) (\s -> hashWithSalt s . nodeId) template_ni R.defaultBucketCount | 87 | -- bkts <- newTVar $ R.nullTable (comparing nodeId) (\s -> hashWithSalt s . nodeId) template_ni R.defaultBucketCount |
88 | sched <- newTVar Int.empty | 88 | sched <- newTVar Int.empty |
89 | lasttouch <- newTVar 0 -- Would use getPOSIXTime here, or minBound, but alas... | 89 | lasttouch <- newTVar 0 -- Would use getPOSIXTime here, or minBound, but alas... |
90 | bootstrapVar <- newTVar True -- Start in bootstrapping mode. | 90 | bootstrapVar <- newTVar True -- Start in bootstrapping mode. |