summaryrefslogtreecommitdiff
path: root/src/proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/proto.c')
-rw-r--r--src/proto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/proto.c b/src/proto.c
index cff3a6a..df47cbb 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -919,8 +919,6 @@ int proto_run(struct dht* dht, char* buff, size_t recv_len, struct sockaddr_in*
}
if(dht->lookup.state == OP_PENDING) {
- dht->lookup.timeout = now + 120;
-
for(size_t i = 0; i < 8; i++) {
dht->lookup.closest_addr[i].port = 0;
}
@@ -939,9 +937,11 @@ int proto_run(struct dht* dht, char* buff, size_t recv_len, struct sockaddr_in*
assert(rc == 0);
}
+ dht->lookup.timeout = now + 120;
dht->lookup.state = OP_ACTIVE;
prom_counter_inc(lookup_count, NULL);
} else if(dht->lookup.state == OP_ACTIVE && dht->lookup.timeout <= now) {
+ dht->lookup.timeout = now + 3600;
dht->lookup.state = OP_COMPLETED;
}