summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-09-19 20:54:12 +0000
committerSander Vrijders <sander.vrijders@ugent.be>2017-09-19 20:54:12 +0000
commit476a3fe224554780b5737ac8db8f9fd39b32fe14 (patch)
tree91b64bbc4be7d894f6e293d26f564691770b9378
parentcbce0036e283673519500d9a461aa4a79473a0cd (diff)
parent55eda88f17cc4192e7211d46b9a9134f4ee93d92 (diff)
downloadouroboros-476a3fe224554780b5737ac8db8f9fd39b32fe14.tar.gz
ouroboros-476a3fe224554780b5737ac8db8f9fd39b32fe14.zip
Merged in dstaesse/ouroboros/be-dht-query-refuse (pull request #601)
ipcpd: Refuse query when DHT not in running state
-rw-r--r--src/ipcpd/normal/dht.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c
index a5d324f0..e7ba4bf3 100644
--- a/src/ipcpd/normal/dht.c
+++ b/src/ipcpd/normal/dht.c
@@ -2165,6 +2165,9 @@ uint64_t dht_query(struct dht * dht,
addrs[0] = 0;
+ if (dht_get_state(dht) != DHT_RUNNING)
+ return 0;
+
pthread_rwlock_rdlock(&dht->lock);
e = dht_find_entry(dht, key);