diff options
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/normal/dht.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c index 3a5229b3..548ae03a 100644 --- a/src/ipcpd/normal/dht.c +++ b/src/ipcpd/normal/dht.c @@ -730,6 +730,7 @@ static void lookup_update(struct dht * dht, struct contact * c = NULL; size_t n; size_t pos = 0; + bool mod = false; assert(lu); assert(msg); @@ -783,6 +784,7 @@ static void lookup_update(struct dht * dht, if (lu->n_contacts < dht->k) { list_add_tail(&c->next, p); ++lu->n_contacts; + mod = true; } else if (pos == dht->k) { contact_destroy(c); continue; @@ -793,10 +795,11 @@ static void lookup_update(struct dht * dht, struct contact, next); list_del(&d->next); contact_destroy(d); + mod = true; } } - if (lu->out == 0) + if (lu->out == 0 && !mod) lu->state = LU_COMPLETE; else lu->state = LU_UPDATE; |