diff options
author | Joe Crayne <joe@jerkface.net> | 2018-12-10 10:19:41 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2018-12-16 14:08:26 -0500 |
commit | 790ec8072f856247c0566b263ee9901bd1cde638 (patch) | |
tree | a776d5588d3d639f6d99e8220e12fdaed642edf2 /src/Network/Kademlia | |
parent | c4c381a5e9295e14382404e88a98af27690c5ec9 (diff) |
Update TCP kademlia table.
Diffstat (limited to 'src/Network/Kademlia')
-rw-r--r-- | src/Network/Kademlia/Bootstrap.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Network/Kademlia/Bootstrap.hs b/src/Network/Kademlia/Bootstrap.hs index 0f5d4e4d..1324ae77 100644 --- a/src/Network/Kademlia/Bootstrap.hs +++ b/src/Network/Kademlia/Bootstrap.hs | |||
@@ -424,3 +424,14 @@ touchBucket r@BucketRefresher{ refreshSearch | |||
424 | modifyTVar' refreshQueue $ Int.insert num (now + interval) | 424 | modifyTVar' refreshQueue $ Int.insert num (now + interval) |
425 | writeTVar refreshLastTouch now | 425 | writeTVar refreshLastTouch now |
426 | return action | 426 | return action |
427 | |||
428 | refreshKademlia :: SensibleNodeId nid ni => BucketRefresher nid ni -> Kademlia nid ni | ||
429 | refreshKademlia r@BucketRefresher { refreshSearch = sch | ||
430 | , refreshPing = ping | ||
431 | , refreshBuckets = bkts | ||
432 | } | ||
433 | = Kademlia quietInsertions (searchSpace sch) (vanillaIO bkts ping) | ||
434 | { tblTransition = \tr -> do | ||
435 | io <- touchBucket r tr | ||
436 | return io | ||
437 | } | ||