aboutsummaryrefslogtreecommitdiff
path: root/src/plugin/dht/plugin_block_dht.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugin/dht/plugin_block_dht.c')
-rw-r--r--src/plugin/dht/plugin_block_dht.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/plugin/dht/plugin_block_dht.c b/src/plugin/dht/plugin_block_dht.c
index aa5ffc719..ede23ea57 100644
--- a/src/plugin/dht/plugin_block_dht.c
+++ b/src/plugin/dht/plugin_block_dht.c
@@ -138,7 +138,7 @@ block_plugin_dht_check_block (void *cls,
138 case GNUNET_BLOCK_TYPE_DHT_HELLO: 138 case GNUNET_BLOCK_TYPE_DHT_HELLO:
139 { 139 {
140 struct GNUNET_HELLO_Builder *b; 140 struct GNUNET_HELLO_Builder *b;
141 struct GNUNET_PeerIdentity pid; 141 const struct GNUNET_PeerIdentity *pid;
142 struct GNUNET_HashCode h_pid; 142 struct GNUNET_HashCode h_pid;
143 143
144 b = GNUNET_HELLO_builder_from_block (block, 144 b = GNUNET_HELLO_builder_from_block (block,
@@ -148,11 +148,10 @@ block_plugin_dht_check_block (void *cls,
148 GNUNET_break (0); 148 GNUNET_break (0);
149 return GNUNET_NO; 149 return GNUNET_NO;
150 } 150 }
151 GNUNET_HELLO_builder_iterate (b, 151 pid = GNUNET_HELLO_builder_iterate (b,
152 &pid, 152 NULL, NULL);
153 NULL, NULL); 153 GNUNET_CRYPTO_hash (pid,
154 GNUNET_CRYPTO_hash (&pid, 154 sizeof (*pid),
155 sizeof (pid),
156 &h_pid); 155 &h_pid);
157 GNUNET_HELLO_builder_free (b); 156 GNUNET_HELLO_builder_free (b);
158 return GNUNET_OK; 157 return GNUNET_OK;
@@ -196,17 +195,16 @@ block_plugin_dht_check_reply (
196 case GNUNET_BLOCK_TYPE_DHT_HELLO: 195 case GNUNET_BLOCK_TYPE_DHT_HELLO:
197 { 196 {
198 struct GNUNET_HELLO_Builder *b; 197 struct GNUNET_HELLO_Builder *b;
199 struct GNUNET_PeerIdentity pid; 198 const struct GNUNET_PeerIdentity *pid;
200 struct GNUNET_HashCode h_pid; 199 struct GNUNET_HashCode h_pid;
201 200
202 b = GNUNET_HELLO_builder_from_block (reply_block, 201 b = GNUNET_HELLO_builder_from_block (reply_block,
203 reply_block_size); 202 reply_block_size);
204 GNUNET_assert (NULL != b); 203 GNUNET_assert (NULL != b);
205 GNUNET_HELLO_builder_iterate (b, 204 pid = GNUNET_HELLO_builder_iterate (b,
206 &pid, 205 NULL, NULL);
207 NULL, NULL); 206 GNUNET_CRYPTO_hash (pid,
208 GNUNET_CRYPTO_hash (&pid, 207 sizeof (*pid),
209 sizeof (pid),
210 &h_pid); 208 &h_pid);
211 GNUNET_HELLO_builder_free (b); 209 GNUNET_HELLO_builder_free (b);
212 if (GNUNET_YES == 210 if (GNUNET_YES ==
@@ -244,7 +242,7 @@ block_plugin_dht_get_key (void *cls,
244 case GNUNET_BLOCK_TYPE_DHT_HELLO: 242 case GNUNET_BLOCK_TYPE_DHT_HELLO:
245 { 243 {
246 struct GNUNET_HELLO_Builder *b; 244 struct GNUNET_HELLO_Builder *b;
247 struct GNUNET_PeerIdentity pid; 245 const struct GNUNET_PeerIdentity *pid;
248 246
249 b = GNUNET_HELLO_builder_from_block (block, 247 b = GNUNET_HELLO_builder_from_block (block,
250 block_size); 248 block_size);
@@ -256,11 +254,10 @@ block_plugin_dht_get_key (void *cls,
256 sizeof (*key)); 254 sizeof (*key));
257 return GNUNET_OK; 255 return GNUNET_OK;
258 } 256 }
259 GNUNET_HELLO_builder_iterate (b, 257 pid = GNUNET_HELLO_builder_iterate (b,
260 &pid, 258 NULL, NULL);
261 NULL, NULL); 259 GNUNET_CRYPTO_hash (pid,
262 GNUNET_CRYPTO_hash (&pid, 260 sizeof (*pid),
263 sizeof (pid),
264 key); 261 key);
265 GNUNET_HELLO_builder_free (b); 262 GNUNET_HELLO_builder_free (b);
266 return GNUNET_OK; 263 return GNUNET_OK;