fix log call: wait until pid is initialized
authorChristian Grothoff <christian@grothoff.org>
Sat, 6 Jan 2018 20:33:13 +0000 (21:33 +0100)
committerChristian Grothoff <christian@grothoff.org>
Sat, 6 Jan 2018 20:33:13 +0000 (21:33 +0100)
src/peerinfo/gnunet-service-peerinfo.c

index bdb6e5e0dee8220f76e7409f356b7d83e247a82f..6b39149bebd3c45803aed1ba6392faffb008b4b1 100644 (file)
@@ -1146,12 +1146,12 @@ handle_hello (void *cls,
   struct GNUNET_SERVICE_Client *client = cls;
   struct GNUNET_PeerIdentity pid;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "HELLO message received for peer `%s'\n",
-              GNUNET_i2s (&pid));
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_HELLO_get_id (hello,
                                       &pid));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "HELLO message received for peer `%s'\n",
+              GNUNET_i2s (&pid));
   add_host_to_known_hosts (&pid);
   update_hello (&pid,
                 hello);