summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_validation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-03 16:11:15 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-03 16:11:15 +0000
commitd9b68f30f930830b455eea95d0bc619553180136 (patch)
treeca3b084bac4c5b52a8b90f916b51d8ea9619510d /src/transport/gnunet-service-transport_validation.c
parentf0b02e3444d7653f2c1dabab449825b80e390855 (diff)
add internal API to enable telling ATS about 'failed' suggestions
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r--src/transport/gnunet-service-transport_validation.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index f0b8d9466..fb2791eba 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -1519,21 +1519,30 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello)
memcmp (&GST_my_identity,
&pid,
sizeof (struct GNUNET_PeerIdentity)))
+ {
+ /* got our own HELLO, how boring */
return GNUNET_OK;
- /* Add peer identity without addresses to peerinfo service */
- h = GNUNET_HELLO_create (&pid.public_key, NULL, NULL, friend);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Validation received new %s message for peer `%s' with size %u\n"),
- "HELLO",
- GNUNET_i2s (&pid),
- ntohs (hello->size));
- GNUNET_PEERINFO_add_peer (GST_peerinfo, h, NULL, NULL);
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- _("Adding `%s' without addresses for peer `%s'\n"), "HELLO",
- GNUNET_i2s (&pid));
+ }
+ if (GNUNET_NO ==
+ GNUNET_CONTAINER_multipeermap_contains (validation_map,
+ &pid))
+ {
+ /* Add peer identity without addresses to peerinfo service */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Adding HELLO without addresses for peer `%s'\n",
+ GNUNET_i2s (&pid));
+ h = GNUNET_HELLO_create (&pid.public_key, NULL, NULL, friend);
+ GNUNET_PEERINFO_add_peer (GST_peerinfo, h, NULL, NULL);
- GNUNET_free (h);
+ GNUNET_free (h);
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Validation received HELLO message for peer `%s' with size %u, checking for new addresses\n",
+ GNUNET_i2s (&pid),
+ ntohs (hello->size));
+ }
GNUNET_assert (NULL ==
GNUNET_HELLO_iterate_addresses (hm,
GNUNET_NO,