fix
authorChristian Grothoff <christian@grothoff.org>
Wed, 10 Feb 2010 15:12:12 +0000 (15:12 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 10 Feb 2010 15:12:12 +0000 (15:12 +0000)
src/core/gnunet-service-core.c

index 59573525b6d0c0617c7dd4f072c19a8b04597074..fa9b00da747be04c427f55d91a9cb6f8fdd33534 100644 (file)
@@ -2342,6 +2342,15 @@ handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m)
 #endif
   if (n->public_key == NULL)
     {
+      if (n->pitr != NULL)
+       {
+#if DEBUG_CORE
+         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                     "Ignoring `%s' message due to lack of public key for peer (still trying to obtain one).\n",
+                     "SET_KEY");
+#endif
+         return;
+       }
 #if DEBUG_CORE
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Lacking public key for peer, trying to obtain one (handle_set_key).\n");
@@ -2349,7 +2358,6 @@ handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m)
       m_cpy = GNUNET_malloc (sizeof (struct SetKeyMessage));
       memcpy (m_cpy, m, sizeof (struct SetKeyMessage));
       /* lookup n's public key, then try again */
-      GNUNET_assert (n->pitr == NULL);
       GNUNET_assert (n->skm == NULL);
       n->skm = m_cpy;
       n->pitr = GNUNET_PEERINFO_iterate (cfg,