summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/dht.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2018-10-11 01:44:29 +0200
committerSander Vrijders <[email protected]>2018-10-11 13:42:38 +0200
commit9b8d2830250ecffb298f6c72196cffb94991f4d1 (patch)
tree8887ddf242f0022b04944704d08508d3b27ec6bb /src/ipcpd/normal/dht.c
parentebf4e472b0065677cb3caf2b67b4bf31fd1f7343 (diff)
downloadouroboros-9b8d2830250ecffb298f6c72196cffb94991f4d1.tar.gz
ouroboros-9b8d2830250ecffb298f6c72196cffb94991f4d1.zip
ipcpd: Speed up enrolment of DHT
The link-state algorithm will now quickly recalculate for link additions (but not for removals, for stability). Upon notification of a new link, the DHT will wait for a brief moment to enroll. This reduces enrolment for large networks by some orders of magnitude. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/ipcpd/normal/dht.c')
-rw-r--r--src/ipcpd/normal/dht.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c
index 4064bf5c..aa1909e9 100644
--- a/src/ipcpd/normal/dht.c
+++ b/src/ipcpd/normal/dht.c
@@ -2729,6 +2729,10 @@ static void handle_event(void * self,
pthread_t thr;
struct join_info * inf;
struct conn * c = (struct conn *) o;
+ struct timespec slack = {0, 10 * MILLION};
+
+ /* Give the pff some time to update for the new link. */
+ nanosleep(&slack, NULL);
switch(dht_get_state(dht)) {
case DHT_INIT: