aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dht/plugin_block_dht.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index 9ff67fa4e..5b6841a98 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -254,14 +254,23 @@ block_plugin_dht_check_reply (
254 } 254 }
255 case GNUNET_BLOCK_TYPE_DHT_URL_HELLO: 255 case GNUNET_BLOCK_TYPE_DHT_URL_HELLO:
256 { 256 {
257 struct GNUNET_HashCode phash; 257 struct GNUNET_HELLO_Builder *b;
258 struct GNUNET_PeerIdentity pid;
259 struct GNUNET_HashCode h_pid;
258 260
259 GNUNET_CRYPTO_hash (reply_block, 261 b = GNUNET_HELLO_builder_from_block (reply_block,
260 reply_block_size, 262 reply_block_size);
261 &phash); 263 GNUNET_assert (NULL != b);
264 GNUNET_HELLO_builder_iterate (b,
265 &pid,
266 NULL, NULL);
267 GNUNET_CRYPTO_hash (&pid,
268 sizeof (pid),
269 &h_pid);
270 GNUNET_HELLO_builder_free (b);
262 if (GNUNET_YES == 271 if (GNUNET_YES ==
263 GNUNET_BLOCK_GROUP_bf_test_and_set (group, 272 GNUNET_BLOCK_GROUP_bf_test_and_set (group,
264 &phash)) 273 &h_pid))
265 return GNUNET_BLOCK_REPLY_OK_DUPLICATE; 274 return GNUNET_BLOCK_REPLY_OK_DUPLICATE;
266 return GNUNET_BLOCK_REPLY_OK_MORE; 275 return GNUNET_BLOCK_REPLY_OK_MORE;
267 } 276 }