-do not crash if we get NACKs or ACKs for disconnected peers
authorChristian Grothoff <christian@grothoff.org>
Tue, 10 Dec 2013 14:37:05 +0000 (14:37 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 10 Dec 2013 14:37:05 +0000 (14:37 +0000)
src/dv/dv_api.c

index eb86b7aec735810da4fd14fa35a16957af3b66da..b93fa79fb343ccbd650d204499ef83f310c5b9a1 100644 (file)
@@ -434,6 +434,12 @@ handle_message_receipt (void *cls,
     ack = (const struct GNUNET_DV_AckMessage *) msg;
     peer = GNUNET_CONTAINER_multipeermap_get (sh->peers,
                                               &ack->target);
+    if (NULL == peer)
+    {
+      GNUNET_break (0);
+      reconnect (sh);
+      return;
+    }
     for (th = peer->head; NULL != th; th = th->next)
     {
       if (th->uid != ntohl (ack->uid))