fixing #1566
authorChristian Grothoff <christian@grothoff.org>
Fri, 2 Jul 2010 07:21:02 +0000 (07:21 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 2 Jul 2010 07:21:02 +0000 (07:21 +0000)
src/core/gnunet-service-core.c

index 5a223d70b4a76e03d7edc94d581db9f9bec7c9d5..b5f608e08e1b7a77528397f26cb0a3da1ebcf1ee 100644 (file)
@@ -3683,10 +3683,13 @@ handle_transport_notify_disconnect (void *cls,
       return;
     }
   GNUNET_break (n->is_connected);
-  cnm.header.size = htons (sizeof (struct DisconnectNotifyMessage));
-  cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT);
-  cnm.peer = *peer;
-  send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_DISCONNECT);
+  if (n->status == PEER_STATE_KEY_CONFIRMED)
+    {
+      cnm.header.size = htons (sizeof (struct DisconnectNotifyMessage));
+      cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT);
+      cnm.peer = *peer;
+      send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_DISCONNECT);
+    }
   n->is_connected = GNUNET_NO;
   GNUNET_STATISTICS_update (stats, 
                            gettext_noop ("# peers connected (transport)"),